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 for the following code, when you passed letsfindcourse at run time?

class CommandLineExample{  
public static void main(String args[]){  
System.out.println(""Your first argument is: ""+args[0]);  
}  
}  

java
CommandLineExample{
arg[0]
letsfindcourse

2. Single line comment starts with _________ in Java.

/**
//
/*
None of these

3. Which of these is a process of converting a simple data type into a class?

type casting
type conversion
type wrapping
None of the Mentioned

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

5. Subexpression $ is used for?

End of the entire string
Beginning of the entire string
Matches any single character not in brackets
Matches the end of the line

6. Which method returns a String that represents the character sequence in the array specified?

int compareToIgnoreCase(String str)
String concat(String str)
boolean contentEquals(StringBuffer sb)
static String copyValueOf(char[] data)

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

instanceOf
import
extends
implement

8. The break statement causes an exit from ______ loop.

innermost
outermost
break statement causes an exit from program
Depends on program

9. Which of the following is the correct way of implementing an interface salary by class manager?

class manager imports salary {}
class manager implements salary {}
class manager extends salary {}
none of the mentioned

10. Which method is automatically called after the browser calls the init method?

start
stop
destroy
paint

Results