wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming Fundamentals (Lab 1)

Total questions: 7

Worksheet time: 5mins

Name
Class
Date
1.

What is the function of the 'dir' command in the command prompt?

a)

Deletes a file

b)

Lists files and directories in the current location

c)

Opens a folder

d)

Copies files

2.

What does the command 'cd ..' do in the command line?

a)

Creates a new directory

b)

Changes file type

c)

Moves to the parent directory

d)

Clears the screen

3.

When saving a Java program file, what should the file extension be?

a)

.txt

b)

.class

c)

.java

d)

.exe

4.

What command is used to compile a Java program in the terminal?

a)

javac

b)

compile

c)

java

d)

exec

5.

After compiling a Java file, which command is used to execute it?

a)

compile

b)

javac

c)

java

d)

run

6.

In a basic Java program, which statement is used to display text on the screen?

a)

echo

b)

print()

c)

display()

d)

System.out.println()

7.

What is the main rule for creating a Java file.

a)

Class Name must be same as the File Name (Exactly Same)

b)

Class Name can be different.

c)

Class Name must be same but in Lower Case Letters all.

d)

Class Name must be same but in Upper Case Letters all.