Objective Objec tive Question Questionss On Core Java Ja va Language Set-2
1) The methods wait() and notify() n otify() are defined in A. java.lang.String B. java.lang.Runnabl java.lang.Runnable e C. java.lang.Object D. java.lang.Thread
2) The data or variables, defined within a class are called ..... variables. A. object B. class C. instance D. schema
3) When we implement the Runnable interface, we must define the method. A. start() B. init()
C. run() D. resume()
4) ........ class must give a concrete method. A. abstract B. constructor C. least D. program
5) Which exception is thrown by the read() method of input stream stream class? A. Exception B. FileNotFoundException C. ReadException D. IOException
6) When a method calls itself, it is called ...... ...... A. recursion B. distance
D. problem
7) Which Whi ch of the following statements st atements are true? true? i) An A n abstract class may not have any final methods. ii) A final class may not have any abstract abstract methods iii) An inner class may be declared with any accessibility keyword iv) Transient Transient variable must be b e static A. i and ii B. ii and iii C. iii and iv D. All i, ii, iii and iv
8) Which Whi ch of the following statements is/ar is/ are e false? A. A java monitor must either eit her extend extend threa th read d or implement imp lement runnable B. The sleep() sleep() method should be enclosed in try t ry .... .... catch block. C. A thread can be temporarily temporarily suspended from running by using the wait() method.
D. A suspended thread using suspend() method can be received received using usin g the resume() method. m ethod.
9) What does J2SE mean? A. Java 2 Platform Platform Standard Edition Ed ition B. Java 2 Internet Standard Edition C. Java 2 System Edition Ed ition D. Java Java 2 Platform Platform Independent In dependent Standard S tandard Edition Edit ion
10) An A n ....... ......... is a special sp ecial kind of Java program program that is designed to be transmi transmitted tted over the Internet. I nternet. A. viewlet B. applet C. servlet D. object 11) Which Whi ch are the valid ways to create create DataI DataI nptStrea nptS tream m streams? A. new DataInputStream(); B. new DataInputStream("in.dat', "r"); C. new DataInputStream(new File("in.dat"));
D. new DataInputStream(new FileInputStream("in.dat");
12) finalize() fin alize() is only called just prior to .... ...... A. initialization B. runtime C. garbage collection D. destruction
13) When we invoke repaint() repaint() for a component, the AWT invokes the method A. draw() B. show() C. update() D. paint()
14) What is the use of valueOf() valueOf() method? A. It I t converts converts data from its internal i nternal format format into in to a humanreadable form. B. It I t converts converts integer in teger value value to string C. It converts string to int value
D. It converts string to float value
15) What is the default thread at the time of starting the program? A. Main thread B. Thread Group C. Child Thread Thread D. Thread Pool
16) What doe d oes s the following line li ne of code code do? TextField TextField text= new TextField( TextField(10); 10); A. Creates text object that can hold 10 rows of text B. Creates Creates text object that can hold 10 columns column s of text C. Creates Creates the object object text and initiali in itialize ze it with the t he value 10 D. The The code is illegal i llegal
17) .......... is an applet tag. A. (applet) B. >applet<
D.