facebook twitter pinterest google plus Youtube
www.TestsTestsTests.com
Free Online Java Tests – Java Fundamentals Test – Java Language Programming

Java Fundamentals Test
Free Online Java Tests
Java Language Programming

Test yourself on the Fundamentals of Java – creating Java comments, statements and block and using identifiers, keywords, literals, data type, variables and operators in the program.


10 Question Multiple Choice Quiz with Answers and Answer Explanations

1) Who developed the Java Programming Language in 1991?
a) James Gosling
b) Dennis Ritchie
c) Kenn Thompson
d) Bjarne Stroustrup

2) Which of the following is an example of a correct comment in Java Programming?
a) // This is a comment
b) /* This is an example
of a comment */

c) /**
This is an example
of a comment*/

d) All of the above

3) Which of the following is NOT an example of a Java Keyword?
a) class
b) int
c) sum
d) new

4) Which of the following is NOT true about an Identifier?
a) An Identifier can start with a letter.
b) An Identifier can start with a number.
c) An Identifier can start with a dollar sign “$” symbol.
d) An Identifier can start with an underscore “_” symbol.

5) What is a type of data that can handle values with and without decimals?
a) The long data type.
b) The int data type.
c) The char data type.
d) The float data type.

6) Which of the following is a correct statement in Java that displays the “Hello World” string?
a) System.out.Print(“Hello World”);
b) system.out.print(“Hello World”);
c) System.out.println(“Hello World”);
d) System.Out.println(“Hello World”);

7) Which of the following is the operator for getting the remainder of a division expression?
a) The plus + symbol.
b) The percent % symbol.
c) The forward slash / symbol.
d) The backward slash \ symbol.

8) Which of the following is not a correct relational operator?
a) The equal to = operator
b) The greater than or equal to >= operator
c) The not equal to != operator
d) The greater than > operator

9) What is the command used in the command prompt to compile a Java program?
a) The java command.
b) The cjava command.
c) The javac command.
d) The compile command.

10) Which logical operator supports short-circuit evaluations in Java?
a) The (boolean logical AND) & operator
b) The (logical AND) && operator
c) The (logical NOT) ! operator
d) The (boolean logical inclusive OR) | operator