Java Programming Quiz


Play this Java quiz that will help you to excel in Java certification exams, placements etc. This Java programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Java programming test enables you to assess your knowledge of Java programming.

Take the Free Practice Test



Java MCQs

Practice Java MCQ Questions, which will help you to understand Java programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

Java Quiz

Try Free Java Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Java Quiz

1. Number of arguments can be passed to main() is?

1
2
3
Infinite

2. The JDBC architecture consists of _____________ to access a database.

three-tier processing models
two-tier processing models
two-tier and three-tier processing models
None of the above

3. which of these will create and start this thread?

  
public class MyRunnable implements Runnable
{
	public void run()
	{
		// some code here
	}
}

new Runnable(MyRunnable).start();
new Thread(MyRunnable).run();
new Thread(new MyRunnable()).start();
new MyRunnable().start();

4. Which of the following is used to test the operation?

JDBC API
JDBC Driver manager
JDBC Test suite
JDBC-ODBC Bridge Drivers

5. What is the output of this program?

  
class Output
{
	public static void main(String args[])
	{
		boolean a = true;
		boolean b = false;
		boolean c = a ^ b;
		System.out.println(!c);
	}
}

0
1
FALSE
TRUE

6. Which of the following is used to declare,construct, and initlaize an array?

int arr [] [] = {1, 2, 3, 4};
int [] arr = (1, 2, 3);
int [] arr = {};
int arr [] = {1, 2, 3};

7. What is the output of this program?

  
class array_output {
   public static void main(String args[])
     {
       char array_variable [] = new char[10];
       for (int i = 0; i < 10; ++i) {
            array_variable[i] = 'i';
            System.out.print(array_variable[i] + """" );
            i++;
       }
    } 
}
		   

i i i i i
0 1 2 3 4
i j k l m
None of the mentioned

8. Predict the output of following Java Program?

  
class Test {
	public static void main(String args[]) {
	 int x = -4;
	 System.out.println(x>>1);
	 int y = 4;
	 System.out.println(y>>1);
	}
}

Compiler Error: Operator >> cannot be applied to negative numbers
-2
2
2
2
2

9. Which of these statements are incorrect?

Assignment operators can be used only with numeric and character data type
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
Assignment operators run faster than their equivalent long forms
None of the mentioned

10. Select from among the following character escape code which is not available in Java.

\\
\v
\a
\t

Results