1) Every statement in Java language should end with a?
A) Dot or Period
2) A function in C language is similar to what in Java language?
3) All methods and variables in Java language are kept inside a?
4) What is the need to mention "static" before main method?
A) To call main method without creating an object of class
B) To make main method as class method common to all instances
5) In standalone Java applications, which method is mandatory?
A) main method
main() is the starting point of execution.
6) What is the use of Access modifier "pubic" in Java language?
A) To hide the main method from misuse
B) To call the main method outside of Class or Package by JVM
C) To protect main method
7) Choose a Single Line Comment in Java Language below?
8) Choose a multiline comment in Java language below?
/*comments are going
cars are moving*/
*/comments are going
cars are moving/*
//comments are going
cars are moving//
String args in main method are used for?
public static void main(String args)
A) Passing arguments at compile time
B) Passing arguments at run time
C) Counting number of words
C:/>java Hello AFRICA GOLDMINE
Hello - Class name
AFICA - First argument
GOLDMINE - Second argument
10) What is the default return type of a method in Java language?
You have to explicitly mention a return type.
11) Name of a Class, Variable, Method or an Interface in Java language is called?
12) A valid identifier in Java language may contain which characters?
13) A valid Identifier or name in Java language can start with which character?
A) a-z, A-Z
Up to JDK 8, only a single underscore symbol can be used as an identifier of a class, method or a variable. JDK 9 does not allow.
14) What are the valid White Spaces available in Java language?
15) Choose a correct version of Java Documentation Comment?
Documentation comment allows writing notes about the program. javadoc commmand on the source java file generates a HTML Java documentation with the embedded comments.