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

Workspace

Comments

2. Size of an integer can be

3 bytes 4 bytes 5 bytes 6 bytes

Workspace

Comments

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

Float Boolean Object None of these

Workspace

Comments

4. Integer is a

Adapter class Inner class Not a class Wrapper class

Workspace

Comments

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

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

Workspace

Comments

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

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

Workspace

Comments

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;

Workspace

Comments

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

Workspace

Comments

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

Integer Boolean Long Short

Workspace

Comments

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

int public boolean double

Workspace

Comments

 

*Click on the QNo to display a Question.

Total Ans