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

2. Size of an integer can be

3 bytes 4 bytes 5 bytes 6 bytes

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

Float Boolean Object None of these

4. Integer is a

Adapter class Inner class Not a class Wrapper class

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

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

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

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

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;

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

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

Integer Boolean Long Short

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

int public boolean double


*Click on the QNo to display a Question.

Total Ans



Aptitude Coaching - Free Live Session !!