Programming  Java  Variables

1. Which of the following is correct statement?

Boolean true value is 1 and false value is 0 Every private class has a wrapper class Constant identifier precede with a reserved word final System.out.println() method also flushes the buffer

Share QNo: 1

2. Size of an integer can be

3 bytes 4 bytes 5 bytes 6 bytes

Share QNo: 2

3. For which of the following data types the ValueOf() method is NOT overloaded in the string class?

Float Boolean Object None of these

Share QNo: 3

4. Integer is a

Adapter class Inner class Not a class Wrapper class

Share QNo: 4

5. Which of the following variable declaration would not compile in Java program?

int VAR; int var1; int 1_var; All are correct

Share QNo: 5

6. Among these expressions, which is(are) of type String?

"0" 0 a. and b. None of these

Share QNo: 6

7. Which of the following line will not compile assuming b1, b2 and b3 are byte variables and J is Int variable?

b1 = 3; b3 = b1 * b2; b3 = 10 * b1; b2 = (byte) j;

Share QNo: 7

8. Which are the valid declarations for an integer literal? (i) 0 (ii) -5 (iii) 0416 (iv) 0xabcdef

(i) and (ii) (i), (ii) and (iii) (iv) All of these

Share QNo: 8

9. Which one does not have a valueOf(String) method?

Integer Boolean Long Short

Share QNo: 9

10. Which of the following is NOT an example of a data type?

int public boolean double

Share QNo: 10


*Click on the QNo to display a Question.

Total Ans