WorksheetsJava Module 1 Quiz
Total questions: 15
Worksheet time: 8mins
Java is currently owned by which company?
Microsoft
Sun Microsystems
Oracle
IBM
What makes Java platform-independent?
It uses HTML
It is only used in Windows
You write the program once and run it on multiple platforms
It doesn’t require compilation
Which of the following is NOT an example of where Java can be used?
Android apps
Web applications
Database creation only
Desktop applications
Which symbol starts a single-line comment in Java?
/* comment */
// comment
<!-- comment -->
** comment **
What is the data type used to store a single character in Java?
String
char
boolean
int
Which operator is used to find the remainder of a division?
/
%
*
#
In postfix form (x++), when is the value of the variable increased?
Before it’s used in the expression
After it’s used in the expression
During program compilation
Never
What does the assignment operator (=) do in Java?
Checks if two values are equal
Assigns a value to a variable
Adds two numbers
Compares two strings
Which of the following is an example of string concatenation in Java?
"Hello" - "World"
"Hello" + "World"
"Hello" * "World"
concat("Hello","World") only
Which class is most commonly used in Java to get user input?
InputReader
Console
Scanner
Reader
Which method from the Scanner class reads an integer value?
nextInt()
nextLine()
readInt()
scanInt()
Which Java data type can store values like true or false?
String
boolean
int
char
What will System.out.println("Hi " + "There"); output?
Hi + There
Hi There
"Hi There"
Error
Which of the following reads an entire line of text input using Scanner?
next()
nextLine()
nextWord()
readLine()
Which of the following is used for documentation comments in Java?
// comment //
/** comment */
<!-- comment -->
** comment **
