wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Q2LQ

Total questions: 50

Worksheet time: 27mins

Name
Class
Date
1.

Java is a platform-independent programming app known by the term W.O.R.A.

a)

Write Once Run Anywhere

b)

Walk Once Run Anywhere         

c)

Write Once, Rewrite Again

d)

Write Once Right Anywhere

2.

Which is NOT a JAVA IDE?

a)

Eclipse

b)

NetBeans

c)

IntelliJ Idea

d)

Notepad

3.

Based on the history of Java what is the name of Java Team Members who initiated the project to develop language for digital devices.

a)

Blue Team

b)

Green Team

c)

Yellow Team

d)

None of the above

4.

______________ is a Canadian computer scientist, best known as the founder and lead designer behind the Java programming language.

a)

Steve Jobs

b)

Bills Gates

c)

James Gosling

d)

None of the above

5.

Java is a popular programming language, created in the year?

a)

1992

b)

1998

c)

1995

d)

1996

6.

When did JAVA change its name from Oak to JAVA?

a)

1996    

b)

1992

c)

1995

d)

1198

7.

Java is owned by _________________.

a)

Oracle Corporation

b)

Microsoft

c)

Google

d)

Adobe

8.

It is a set of steps that are used to help complete a task.

a)

Debugging

b)

Data

c)

Algorithm

d)

None of the above

9.

__________are containers for storing data values.

a)

Variable

b)

Data

c)

String

d)

Int

10.

Which of these methods is given parameters via command line arguments?

a)

main()

b)

recursive() method

c)

Any method

d)

System defined methods

11.

It is the operators that represent if a number is positive or negative.

a)

Arithmetic Operators

b)

Unary Operators

c)

Relational Operators

d)

Increment Operators

12.

How do you create a variable with the numeric value 5?

a)

float x = 5;

b)

x = 5;

c)

int x = 5;

d)

num x = 5

13.

It is used to perform common mathematical operations.

a)

Arithmetic Operators

b)

Unary Operators

c)

Relational Operators

d)

Increment Operators

14.

Which data type is used to create a variable that should store text?

a)

myString

b)

String

c)

Txt

d)

string

15.

How do you create a variable with the floating number 2.8?

a)

byte x = 2.8f

b)

x = 2.8f;

c)

float x = 2.8f;

d)

int x = 2.8f;

16.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

17.

which one this keywords are used to create a class in java

a)

class

b)

struct

c)

int

d)

none of the avove

18.

++ increases the value of a variable by 1

a)

assignment operator

b)

decrement operator

c)

increment operator

d)

sentinel

19.

What was Java originally designed for?

a)

Interactive TV

b)

Internet

c)

Gaming

d)

Cars

20.

%d, %f, %s are called ___________.

a)

Symbol

b)

Format Specifier

c)

Cue

d)

Percent

21.

Find the missing syntax.

a)

{

b)

main

c)

println

d)

);

22.

Find the missing syntax.

a)

{

b)

main

c)

println

d)

);

23.

Find the missing syntax.

a)

{

b)

main

c)

println

d)

);

24.

Find the missing syntax.

a)

{

b)

main

c)

println

d)

);

25.

Find the missing syntax.

a)

out

b)

System.out

c)

;

d)

System

26.

Find the missing syntax.

a)

out

b)

System.out

c)

;

d)

System

27.

What is the output?

a)

150

b)

100

c)

50

d)

200

28.

What is the output?

a)

"Hello"

b)

Hello

c)

Hello;

d)

= Hello

29.

What is the output?

a)

John

b)

Doe

c)

JohnDoe

d)

John Doe

30.

What is the output?

a)

0

b)

20

c)

30

d)

10

31.

__________________ allows a program to take action based on the given condition. It makes your program smarter.

a)

Conditional Statement

b)

Relational operators Statement

c)

Switch Statement

d)

If Statement

32.

__________________ is similar to a conditional statement but only checks for equality and only works with strings, char, int, and enums.

a)

Conditional Statement

b)

Relational operators Statement

c)

Switch Statement

d)

If Statement

33.

Use the ____________ to specify a block of Java code to be executed if a condition is true

a)

Conditional Statement

b)

Relational operators Statement

c)

Switch Statement

d)

If Statement

34.

Use the ____________ to specify a block of code to be executed, if the same condition is false.

a)

Else If Statement

b)

Else Statement

c)

Switch Statement

d)

If Statement

35.

Use the ____________ to specify a new condition to test, if the first condition is false.

a)

Else If Statement

b)

Else Statement

c)

Switch Statement

d)

If Statement

36.

Which of the following is NOT a numeric data type

a)

int

b)

double

c)

float

d)

decimal

37.

We use Scanner Library in java for...

a)

Give permissions to the user

b)

Correcting software errors

c)

Allows user to read data

d)

Allows the user to enter data

38.

Which operator is used to add together two values?

a)

The + sign

b)

The * sign

c)

The & sign

39.

How will you code a single-line comment in java?

a)

/* */

b)

//

c)

**

d)

||

40.

How will you code a multi-line comment in java?

a)

/* */

b)

//

c)

**

d)

||

41.

Is Java short for "JavaScript"?

a)

True

b)

Maybe

c)

False

d)

Sometimes

42.

which of the following is wrapper class in java

a)

Float

b)

Integer

c)

Double

d)

all of above

43.

_________ operator returns the remainder after division

a)

+

b)

/

c)

%

d)

*

44.

________ operator is used to check the equality of two values

a)

>=

b)

=

c)

*=

d)

==

45.

String s1 = "hello";

String s2 = new String("hello");

if (s1 == s2) System.out.print("Hey");

else System.out.print("Yo");


What is the output?

a)

Hey

b)

Yo

c)

There is no output.

d)

This code will not compile.

46.

Int data types represents _______ bits.

a)

8

b)

16

c)

32

d)

64

47.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
48.

int x = 5;

int y = 6

int z = 50;

System.out.println(x + y + z);


What will be the output?

a)

61

b)

5650

c)

66

d)

x + y + z

49.

Which of the following is the right way of defining char variable?

a)

char myGrade = 'B';

b)

char myGrade = "B";

c)

char myGrade 'B';

d)

char myGrade = "B"

50.

JDK stands for

a)

Java Developer Kit

b)

Java Development Kit

c)

Java Design Kit

d)

Java Debugging Kit