Java Programming Questions & Answers: part15



Software Programming : Java Programming QUESTIONS AND ANSWERS :: part15 : 1 to 5

Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :

1.Which of the following are the wrapper classes? I. Random. II. Byte. III. Integer. IV. Short. V. Double.

(II), (III), (IV) and (V) above
(II), (III) and (IV) above
(II), (III) and (V) above
(III), (IV) and (V) above
All (I), (II), (III), (IV) and (V) above.

2.Which of the following will produce an error? #231. Which of the following will produce an error? I. byte a1 = 2, a2 = 4, a3; II. short s = 16; III. a2 = s; IV. a3 = a1 * a2;

Both (III) and (IV) above
Only (II) above
Only (III) above
Only (IV) above
Both (I) and (IV) above.

3.How to declare a class which has fields that are not serializable?

Public
Private
Protected
Variant
Transient.

4.Consider the class definition: public class MyClass { int x; int y; void myprint(){ System.out.println(“x = ” +x); System.out.println(“Y = ” +y); } } Which of the following is a correct way to create an object?

MyClass mc=new MyClass();
MyClass mc;
MyClass mc=new MyClass(10,20);
MyClass mc=MyClass(10,20);
All the above.

5.Which of the following is not a valid String Constant?

“X”
‘x’
“Hello”
“2002”
“Hello Guys”.

More Java Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
If you are not willing to risk the usual you will have to settle for the ordinary- Jim Rohn