wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Introduction

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.
Which of the following is a correct header line for main in a Java program?
a)
public static void main(args)
b)
public static void main(String args)
c)
public static void main(args [ ])
d)
public static void main(String [ ] args)
2.
What does a comment look like in Java?
a)
//comment
b)
\\comment
c)
==comment
d)
\comment
3.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
4.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
5.
A variable that holds true or false
a)
String
b)
boolean
c)
int
d)
float
6.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
7.

What is the old name for Java Programming?

a)

Java 2

b)

Java

c)

Oak

d)

C++

8.

Java is closely related to _________ programming language

a)

C

b)

Cobol

c)

C++

d)

Pascal

9.

What is the file extension for Java Source Code?

a)

.java

b)

.class

c)

.exe

d)

.obj

10.

What is the file extension for Java Executable Code?

a)

.java

b)

.class

c)

.exe

d)

.obj

11.

Java is case sensitive?

a)

True

b)

False

12.

public static void main (String [] args) is a:

a)

Program Container

b)

Main Method

c)

Statement Block

d)

Sentence

13.

All statements must end with:

a)

full stop (.)

b)

comma (,)

c)

semi colon (;)

d)

exclamation mark (1)

14.

For paragraph comment, you should use:

a)

/

b)

//

c)

/*......*/

d)

*/....*/

15.

He is the developer of Java Programming Language

a)

Dennis Ritchie

b)

James Gosling

c)

Bjarne Stroustrup

d)

Ken Thompson

16.

which of the following is NOT a function of Integrated Development Environment?

a)

debug

b)

compile

c)

edit program

d)

create a flowchart

17.

It is a type of java program that can be embedded in a web.

a)

general purpose application

b)

standalone applications

c)

applet

d)

webpage

18.

which of the following is a data type that can store number with decimal point?

a)

int

b)

byte

c)

short

d)

double

19.

which of the following data types that has only two possible option

a)

byte

b)

boolean

c)

character

d)

integer

20.
Which of the following best describes what a variable is in computer programming terms?
a)
the value of x
b)
the value of y
c)
A named location of the computer's memory that will store data
d)
Any data that a computer will need to store
21.

Tools that provide support for software development process including editors and debuggers are called

a)

integrated development environments

b)

bytecode converters

c)

virtual machine converters

d)

memory verifier

22.

Pick the correct syntax.

a)

if(x == 5) {}

b)

if(x = 5) {}

c)

if x == 5 {}

d)

if x = 5 {}

23.

How many times will this loop run?

int x = 4;

while(x < 4) {

x = x + 1;

}

a)

0

b)

3

c)

4

d)

5

24.

Which of the following will result in a double

a)

1.0 + 3

b)

3 / 5

c)

(int)3.0

d)

5 * 200

25.

When was Java released?

a)

1975

b)

1985

c)

1991

d)

1995