Enter your search terms
Submit search form
Web
examineonline.googlepages.com
Online Exam
>>
Programming
>>
Java
>>
Java Practice 3
Menu
Programming
COMPTIA
GMAT
English
IQ
DataBase
OS
MCSE
CISCO
Finance
Management
Health
Soft Skills
Web Building
Multimedia
Java Practice 3
1 . What are the two types of multitasking? 1. Process-based 2. Thread-based
A.
1
B.
2
C.
Both 1,2
D.
None of the above
2 . What are the two ways to create the thread?
A.
by implementing Runnable
B.
by extending Thread
C.
Both a and b
D.
None of the above
3 . What is the signature of the constructor of a thread class?
A.
Thread(Runnable threadob,String threadName)
B.
Thread(String threadob, Runnable threadName)
C.
Thread(Runnable threadob,ArrayList threadName)
D.
Thread(ArrayList threadob,String threadName)
4 . What is the data type for the method isAlive() and this method is available in which class/interface?
A.
boolean, Thread
B.
String, Thread
C.
Boolean, Runnable interface
D.
String, Runnable Interface
5 . Which of the following holds true for the daemon thread, in java runtime,
A.
Daemon thread is a low priority thread
B.
It runs intermittently in the background
C.
It does the garbage collection operation for the java runtime system.
D.
All of the above
6 . What are all the methods available in the Thread class?
A.
isAlive(),join()
B.
resume(),suspend()
C.
stop(),start()
D.
sleep(),destroy()
7 . What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
A.
wait(),Object class
B.
notify(),Object class
C.
notifyall(),Object class
D.
wait(), Thread class
8 . Fill in the blanks : - What is the mechanisam defind by java for the Resources to be used by only one Thread at a time________________
A.
Synchronized
B.
Synchronization
9 . State true or false :- Is the procedure to own the moniter by many threads?
A.
True
B.
False
10 . What is the unit for 1000 in the below statement? ob.sleep(1000)
A.
Int milliseconds
B.
Double milliseconds
C.
long milliseconds
D.
Float milliseconds
11 . What is the data type for the parameter of the sleep() method?
A.
double
B.
int
C.
long
D.
float
12 . What are all the values for the following level, respectively? max-priority min-priority normal-priority
A.
10,1,5
B.
1,10,15
C.
10,10,5
D.
10,5,1
13 . Fill in the blanks :- The method available for setting the priority in the thread is ______________?
A.
setDaemon()
B.
setPriority()
C.
getPriority()
14 . What is the default thread at the time of starting the program?
A.
main thread
B.
thread group
C.
child thread
D.
thread pool
15 . State true or false :- The word synchronized can be used with only a method.
A.
True
B.
False
16 . Fill in the blanks :- Which priority Thread can prompt the lower primary Thread_______?
A.
Lower Priority
B.
Higher Priority
C.
Normal Priority
17 . How many threads at a time can access a monitor?
A.
one
B.
two
C.
three
D.
none
18 . What are all the four states associated in the thread?
A.
new
B.
runnable
C.
blocked
D.
dead
19 . State true or false :- The suspend()method is used to terminate a thread?
A.
True
B.
False
20 . State true or false :- The run() method should necessary exists in class created as subclass of thread?
A.
True
B.
False
21 . State true or false :- When two threads are waiting on each other and can't proceed the program is said to be in a deadlock?
A.
True
B.
False
22 . Fill in the blanks :- Which method waits for the thread to die______________ ?
A.
wait()
B.
join()
C.
notify()
23 . Which of the following is true? 1) wait(),notify(),notifyall() are defined as final & can be called only from with in a synchronized method 2) Among wait(),notify(),notifyall() the wait() method only throws IOException 3) wait(),notify(),notifyall() & sleep() are methods of object class
A.
1
B.
2 & 3
C.
1 & 2
D.
1 ,2 & 3
24 . What is the priority of the Garbage collector thread of jdk.?
A.
low-priority
B.
highest priority
C.
medium priority
D.
decided at runtime
25 . What is meant by timeslicing or time sharing?
A.
Timeslicing is the method of de-allocating CPU time to individual threads in a priority schedule.
B.
Timeslicing is the method of allocating CPU space to individual threads in a priority schedule.
C.
Timeslicing is the method of allocating CPU time to individual threads in a priority schedule.
D.
Timeslicing is the method of de-allocating CPU space to individual threads in a priority schedule.
26 . The Java interpreter is used for the execution of the source code .
A.
True
B.
False
27 . State true or false :- On successful compilation a file, with the .class extension is created.
A.
True
B.
False
28 . What are the part(s)in executing a Java program and their purposes?
A.
Java Compiler
B.
Java Interpreter.
C.
Both of the above
D.
None of the above
29 . Which is the correct description of the OOPs principles?
A.
Encapsulation:Is the Mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
B.
Inheritance:Is the process by which one object acquires the properties of another object.
C.
Polymorphism:Is a feature that allows one interface to be used for a general class of actions.
D.
All the above
30 . In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true ?
A.
It must have a package statement
B.
It must be named Test.java
C.
It must import java.lang
D.
It must declare a public class named Test
31 . Which of the option correctly describes the comments in java 1) // -- single line comment 2) /* -- */ multiple line comment 3) /** -- */ documentation
A.
1, 2
B.
2, 3
C.
3, 1
D.
1, 2, 3
32 . Which of the following declare an array of string objects? (Select Multiple)
A.
String[ ] s;
B.
String [ ]s:
C.
String s[ ]:
D.
String[ s]:
Test Name :
Java Practice 3
Category :
Java
Number of Question :
32
Pass Score :
80
Test Result
Your Score :
Passing Score :
80
Result :
Copyright by
VanTuMinh
© 2007