20

Quiz Time: 10mins

10 minutes


Created on

Java Basics

1 / 8

1. Choose the correct answer for the following code snippet:

final int CONSTANT=13;
System.out.println(CONSTANT+7);

2 / 8

2. Choose the correct answer for the following code snippet:

int data[]={11,22,33,44,55};
for(int value : data)
System.out.println(data[value]);

3 / 8

3. Choose the correct answer for the following code snippet:

int a=4;
if(a<=3);
System.out.print("Hello");
System.out.print("Hi");

4 / 8

4. Choose the correct answer for the following code snippet:

int a=5;
float b=2;
int c=a/b;
System.out.println(c);

5 / 8

5. Choose the correct answer for the following code snippet:

int num = -1;
do
{
num - - ;
}while ( num > = 2 );
System.out.println( num );

6 / 8

6. Choose the correct answer for the following code snippet:

int A, B=9, C=6;
A = B+C/3+A;
System.out.println(A);

7 / 8

7. What will be the output of following code snippet

int A, B=9, C=6;
A = B+C/3+A;
System.out.println(A);

8 / 8

8. What will be the output of following code snippet:

int num = -1;
do
{
num - - ;
}while ( num > = 2 );
System.out.println( num );

Your score is

The average score is 44%

0%

Practice Forms