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. 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

2. Java SE 15 version released on?

March 19, 2019
March 17, 2020
September 17, 2019
September 15, 2020

3. What is the output of this program?

  
class Output
{
	public static void main(String args[])
	{
		int x , y = 1;
		x = 10;
		if (x != 10 && x / 0 == 0)
			System.out.println(y);
		else
			System.out.println(++y);
	}
}		   

1
2
Runtime error owing to division by zero in if condition
Unpredictable behavior of program

4. What will be the output of the program?

  
int arr[] = new int [5];
System.out.print(arr);

0
value stored in arr[0].
0
Class name@ hashcode in hexadecimal form

5. A for loop is useful when you know how many times a task is to be repeated.

TRUE
FALSE
Can be true or false
Can not say

6. File Class is inside which package?

java.util
java.awt
java.lang
java.io

7. What is the output of this program?

class Main
{
public static void main(String args[])
	{
		int x = 8;
		System.out.println(++x * 3 + " " + x);
	}
}

24 8
24 9
27 8
27 9

8. Which of the following is not a Components of JDBC ?

JDBC API
JDBC Test suite
JDBC-ODBC Bridge Drivers
JDBC Call

9. How many kinds of variables in Java?

2
3
4
5

10. Which of these class is related to all the exceptions that cannot be caught?

Error
Exception
RuntimeExecption
All of the mentioned

Results