Multiple Choice Questions of Java
1.Which method name follows the javabeans std :Getcust
2.You cannot close() method in : Drivermanager Object
3. Not a javascriptwindowobject func?
alert
prompt
confirm
all
Ans: all
4. garbage collector daemon chooses which of these objects to perform its function? Unreachable obj.
5. Invalid format string:
%ld
%lf
%lu
%lc
Ans :%lc
6. write() method is associated with which javascript object Ans: Document
7. Static method pertainng to a state of a thread Ans: yield and sleep
8. Java isnan when an object on page uses focus which event occurs Ans: on blur
9. Which is valid java script identifier:first name, _123 123_ a*b
Ans: _123
10. Content of ur webpage r contained directly within which object Ans :Document
11.Start and end od HTML table cell??
Ans: <td> </td>
12.Where can objects store its states? Ans: Fields
13. method - local class > can b marked Ans: final
14.What could one use to create threads in java? a) runnable interface (b) thread class (c) runnable class (d) thread interface
Ans: a b
15.Does anabstract class can have both abstract nd concrete methoks? Ans:Yes
16. Which operator compares an object to specified type in java? Ans; instanceOf
17. marker interface is …….. Ans:an empty interface
18. Which of foll methods belong to object class
a)run()
b) notify()
c) start()
d) wait()
e) notifyAl()
Ans:b d e
19. %lf stands for? Ans: long double
20.Which of the following are valid return statements?
1. return(10);
2 .return (10.15);
3 .return;
Ans: 1,2,3
21. what is garbage collector? Ans: low priority thread
22. when new classes of objects are developed by this process, the resulting collections of classes is called a class of Ans: Collections
23. in main (int argc,char " argv[] ), the argument argc represents Ans:count of total no of arguments
24.Which of the following is not a valid heading tag?
1 <h 1> </h1>
2 <h3> </h3>
3 <h5>
4 <h7>
Ans:<h7>
24. Which is a valid keyword in java?
A. interface B. String C. Float D. Unsigned
Ans: interface
25. which is not derived data type?
1 class
2 function
3 reference
4 array...
26. In java which is the single parameter defined by the main method ?
1 str
2 args
3 int
4 both a and b
Ans:args
27. In JDBC which of the following is a wrapper object for the sql query ?
1 connection
2 result set
3 database metadata
4 statement
Ans:resultset
28.Which of the following is true about abstract class?
1.An abstract class can have abstract methods only
2.An abstract class can have abstract as well as concrete methods
3.An abstract class cannot have any methods
4.It is not possible to have an abstract class without abstract methods
5.An abstract class cannot de initialized
Ans: 2 and 5
29. In java which of these is thread safe by default
1.hash set
2.list
3.vector
4.all the above
Ans:Vector
30. which is true
string class is mutable
string class is final
string class is abstract
1.a&b...
2.a,b&c
3.a&c
4.b&c
Ans:
31. In java script what do isNaN functon indicate
Ans: Checks whether the given value is a number or not and returns a boolean value
32.The runnable interface consists of:
Ans: Run() and start() methods
33. Assume that there are two cases. A is the base class nd B is the derived class. the default contructer of which class will be called first?
Ans:Base class
34. To perform operations such as setw, setprecision on streams, which header files has to be included?
1 iostrem
2 fstream
3 sstream
4 iomanip
Ans: iomanip
31.Which of the following pair is used to create bulleted lists?
Ans:<bl> </bl>
32.How to specify the start and end of an HTML table row?
Ans:<tr> </tr>
33. .OUTPUT????
class abc
{
public static void main(String args[])
{
byte a=64,b;
int i;
i=a<<2;
b=(byte)(a<<2);
System.out.println("a="+a);
System.out.println("i and b="+i+" "+b);
}
}
Ans: a=64
i and b=2560
34.
27.int bar=1;{
int bar=2;
println(bar);
}
opn;compile error bar=1 bar=2 run time error Ans:Compiler Error
1.Which of the following is req 4 construction of singly linked list??
Ans : malloc()
2. Which data structure needs only 1 pointer to manage links?
Ans:Arrays
3. It is syntactically valid to define a func in to anothr func
True
False
Ans : True
stay connected for more updates
1.Which method name follows the javabeans std :Getcust
2.You cannot close() method in : Drivermanager Object
3. Not a javascriptwindowobject func?
alert
prompt
confirm
all
Ans: all
4. garbage collector daemon chooses which of these objects to perform its function? Unreachable obj.
5. Invalid format string:
%ld
%lf
%lu
%lc
Ans :%lc
6. write() method is associated with which javascript object Ans: Document
7. Static method pertainng to a state of a thread Ans: yield and sleep
8. Java isnan when an object on page uses focus which event occurs Ans: on blur
9. Which is valid java script identifier:first name, _123 123_ a*b
Ans: _123
10. Content of ur webpage r contained directly within which object Ans :Document
11.Start and end od HTML table cell??
Ans: <td> </td>
12.Where can objects store its states? Ans: Fields
13. method - local class > can b marked Ans: final
14.What could one use to create threads in java? a) runnable interface (b) thread class (c) runnable class (d) thread interface
Ans: a b
15.Does anabstract class can have both abstract nd concrete methoks? Ans:Yes
16. Which operator compares an object to specified type in java? Ans; instanceOf
17. marker interface is …….. Ans:an empty interface
18. Which of foll methods belong to object class
a)run()
b) notify()
c) start()
d) wait()
e) notifyAl()
Ans:b d e
19. %lf stands for? Ans: long double
20.Which of the following are valid return statements?
1. return(10);
2 .return (10.15);
3 .return;
Ans: 1,2,3
21. what is garbage collector? Ans: low priority thread
22. when new classes of objects are developed by this process, the resulting collections of classes is called a class of Ans: Collections
23. in main (int argc,char " argv[] ), the argument argc represents Ans:count of total no of arguments
24.Which of the following is not a valid heading tag?
1 <h 1> </h1>
2 <h3> </h3>
3 <h5>
4 <h7>
Ans:<h7>
24. Which is a valid keyword in java?
A. interface B. String C. Float D. Unsigned
Ans: interface
25. which is not derived data type?
1 class
2 function
3 reference
4 array...
26. In java which is the single parameter defined by the main method ?
1 str
2 args
3 int
4 both a and b
Ans:args
27. In JDBC which of the following is a wrapper object for the sql query ?
1 connection
2 result set
3 database metadata
4 statement
Ans:resultset
28.Which of the following is true about abstract class?
1.An abstract class can have abstract methods only
2.An abstract class can have abstract as well as concrete methods
3.An abstract class cannot have any methods
4.It is not possible to have an abstract class without abstract methods
5.An abstract class cannot de initialized
Ans: 2 and 5
29. In java which of these is thread safe by default
1.hash set
2.list
3.vector
4.all the above
Ans:Vector
30. which is true
string class is mutable
string class is final
string class is abstract
1.a&b...
2.a,b&c
3.a&c
4.b&c
Ans:
31. In java script what do isNaN functon indicate
Ans: Checks whether the given value is a number or not and returns a boolean value
32.The runnable interface consists of:
Ans: Run() and start() methods
33. Assume that there are two cases. A is the base class nd B is the derived class. the default contructer of which class will be called first?
Ans:Base class
34. To perform operations such as setw, setprecision on streams, which header files has to be included?
1 iostrem
2 fstream
3 sstream
4 iomanip
Ans: iomanip
31.Which of the following pair is used to create bulleted lists?
Ans:<bl> </bl>
32.How to specify the start and end of an HTML table row?
Ans:<tr> </tr>
33. .OUTPUT????
class abc
{
public static void main(String args[])
{
byte a=64,b;
int i;
i=a<<2;
b=(byte)(a<<2);
System.out.println("a="+a);
System.out.println("i and b="+i+" "+b);
}
}
Ans: a=64
i and b=2560
34.
27.int bar=1;{
int bar=2;
println(bar);
}
opn;compile error bar=1 bar=2 run time error Ans:Compiler Error
1.Which of the following is req 4 construction of singly linked list??
Ans : malloc()
2. Which data structure needs only 1 pointer to manage links?
Ans:Arrays
3. It is syntactically valid to define a func in to anothr func
True
False
Ans : True
stay connected for more updates
No comments:
Post a Comment