wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Introduction To Java: Hello World

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

What is JAVA?

a)

Programming language

b)

Games

c)

Script

d)

Interface

2.

public class HelloWorld {

  public static void main(String[] args) {

   }

}

What is the output?

a)

HelloWorld

b)

Hello World

c)

Error message

d)

No output

3.

Java programs have at least one X and one main() X. What is X?

a)

Class and compiler

b)

compiler and method

c)

class and method

d)

compiler and output

4.

System.out.print("Two...");

    System.out.println("One...");

What is the output?

a)

Two...

One...

b)

One...Two...

c)

One...Two

d)

Two...One...

5.

Which is the right symbol for comment?

a)

||

b)

\\

c)

//

d)

**

6.

Which one is the incorrect line of code?

a)

public class Monkey{}

b)

public static void main[String() args]{}

c)

String monkey=" monkey has 2 legs);

d)

System.out.println("Monkey is cute");

7.

What is the purpose of compiling process?

a)

Get the output

b)

Print the output

c)

Run the code

d)

Catches the mistake

8.

Javac is one of the way to?

a)

compile

b)

print

c)

terminal

d)

file

9.

What is the right command for compile class Song.java?

a)

java Song.java

b)

Javac song.java

c)

javac Song.java

d)

Java Song.java

10.

What is this code for?

a)

method

b)

compiler

c)

class

d)

output