Class Test

Computer Applications

1. Arrays index value starts with?

Correct Answer
0

2. Which keyword indicates that method has no return type ?

Correct Answer
void

3. Which keyword makes the variable as a class variable?

Correct Answer
static

4. What's the storage size of 'short' and 'float'?

Correct Answer
2 and 4

5. What's the output of the following?

String P = "20", Q = "19";
int a = Integer.parseInt(P);
int a = Integer.valueOf(Q);
System.out.print(a + " " + b);
Correct Answer
20 19

6. What's the return type and 'res' after following is exicuted?

char ch = '9';
res = Character.isDigit(ch);
Correct Answer
boolean

7. What's return type of startsWith( ) & random( ) ?

Correct Answer
boolean & double

8. What's the 'tax' in the following if 'basic = 1500'?

tax = basic > 1200 ? 200 : 100;
Correct Answer
200

9. What's the output of the following code?

for( int i = 5; i >= 1; i-- )
{
if( i % 2 == 1 )
continue;
System.out.print( i + " " );
}
Correct Answer
4 2

10. Find the value of 'v' if x=2, y=3, z=1

v = x + --z + y++ + y;
Correct Answer
10

Result