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. In Java, a sequence of data is known as a stream.

TRUE
FALSE
Can be true or false
Can not say

2. Which loop guaranteed to execute at least one time?

for
do-while
while
All of the above

3. What is the output of this program?

  
class comma_operator
{
	public static void main(String args[])
	{
		int sum = 0;
		for(int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1)
			sum += i;
			System.out.println(sum);
	}
}

5
6
14
compilation error

4. Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?

Integer hashcode()
int hashcode()
int hashCode()
int hash()

5. Which statement causes the loop to immediately jump to the next iteration of the loop?

Exit
Break
Jump
Continue

6. Which of these data types is used to store command line arguments?

Array
Stack
String
Integer

7. Which of these is a super class of all exceptional type classes?

String
RuntimeExceptions
Throwable
Cacheable

8. Which of the following would compile without error?

int a = Math.abs(-5);
int b = Math.abs(5.0);
int d = Math.abs(5L);
int c = Math.abs(5.5F);

9. An _______________ statement can be used to access the classes and interface of a different package from the current package.

instanceOf
import
extends
implement

10. Which of the following is an Example of variable initialization?

int a, b, c;
int a = 10, b = 10;
int 10 = a;
None of the above

Results