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 this QA

2. Size of an integer can be

3 bytes 4 bytes 5 bytes 6 bytes

Share this QA

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 this QA

4. Integer is a

Adapter class Inner class Not a class Wrapper class

Share this QA

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

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

Share this QA

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

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

Share this QA

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 this QA

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 this QA

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

Integer Boolean Long Short

Share this QA

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

int public boolean double

Share this QA

 

*Click on the QNo to display a Question.

Total Ans