Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit_1_Object Oriented Programming with Java

Total questions: 50

Worksheet time: 38mins

Name
Class
Date
1.

Java was originally named:

a)

New C++

b)

Coffee

c)

Duke

d)

Oak

2.

From where did Java get its name?

a)

Book

b)

Initials of the developers of Java

c)

Coffee

d)

TV Programme

3.

Is Android based on Java?

a)

True

b)

False

4.

When was Java released?

a)

1975

b)

1985

c)

1995

d)

2005

e)

2015

5.

Who invented Java?

a)

Sergey Brin

b)

James Gosling

c)

Steve Jobs

d)

Bill Gates

6.

What was Java originally designed for?

a)

Internet

b)

Consumer electronic devices like TVs, VCRs & toasters etc

c)

Cars

d)

Gaming

7.

Currently which company owns Java?

a)

Microsoft

b)

Google

c)

Oracle

d)

Apple

e)

Intel

8.

Explain JDK

a)

It stands for Java Development Kit

b)

It is the tool necessary to compile, document and package Java programs

c)

Both 1 and 2

d)

None of the above

9.

Explain JRE

a)

It stands for Java Runtime Environment

b)

It stands for Java Root Environment

c)

JRE refers to a runtime environment in which java bytecode can be executed.

d)

None of the above

10.

Explain JVM

a)

It stands for Java Virtual Machine

b)

It is an abstract machine. It is specification that provides run-time environment in which java bytecode can be executed

c)

Both 1 and 2

d)

None of the above

11.

public is a/an

a)

keyword

b)

return type

c)

access modifier

d)

method

12.

static is a/an

a)

keyword

b)

return type

c)

access modifier

d)

method

13.

void is a/an

a)

keyword

b)

return type

c)

access modifier

d)

method

14.

main is a/an

a)

keyword

b)

return type

c)

access modifier

d)

method

15.

main(String[] args) is an

a)

keyword

b)

return type

c)

access modifier

d)

method

16.

" main(String[] args) "

In the above code 'String' is

a)

keyword

b)

class

c)

object

d)

method

17.

Java is 100% Object-oriented Language

a)

True

b)

False

18.

Where does a java program start executing instructions from:

a)

class

b)

source file

c)

main method

d)

object

19.

We are use Scanner Library in java for...

a)

Correcting software errors

b)

Give permissions to the user

c)

Allows the user to write data

d)

Allows the user to enter data

20.

When we want to print in Java, we use the code ......

a)

system.out.print();

b)

System.out.println();

c)

System.Out.Printf();

d)

All of the above

21.

What is at the end of a line of code?

a)

#

b)

;

c)

)

d)

>

22.

What does a comment look like in Java?

a)

\\comment line

b)

#comment line

c)

//comment line

d)

---comment line

23.

How do I insert a multi-line comment?

a)

? Comment lines ?

b)

/* Comment lines */

c)

//Comment lines //

d)

-Java Comment lines -

24.

What value is stored in result if:


int result = 13 - 3 * 6 / 4 % 3;

a)

-5

b)

0

c)

13

d)

-1

e)

12

25.

2 + 3 * 12 / 7 - 4 + 8

a)

5

b)

12

c)

11

d)

-4

e)

9

26.

What are the 4 basic components of a computer system?

a)

Processor, RAM, ROM and the bus

b)

Processor, hard drive, VGA port and USB

c)

Processor, Main Memory, Secondary Memory and I/O

d)

Processor, RAM, I/O and Windows

27.

What is a good example of an input device?

a)

monitor

b)

printer

c)

webcam

d)

speakers

28.

What is a good example of an output device?

a)

headphones

b)

microphone

c)

mouse

d)

keyboard

29.

Which one is NOT the basic element of OOP?

a)

Class

b)

Abstraction

c)

IntelliJ

d)

Polymorphism

30.

Java will ignore whitespace in code.

a)

True

b)

False

31.

What is the purpose of a Java Runtime Environment?

a)

Enables development of Java programs.

b)

Software to help you write programs.

c)

Enables the Execution of java programs.

32.

What is source code?

a)

Running the code starting at the main method.

b)

Checking your code for syntax errors and putting it into a .class file

c)

Code written as a .java file that can be edited in a text editor or IDE

33.

What does it mean to compile code?

a)

Running the code starting at the main method.

b)

Code written as a .java file that can be edited in a text editor or IDE

c)

Checking your code for syntax errors and putting it into a .class file

34.

What does it mean to execute code?

a)

Running the code starting at the main method.

b)

Code written as a .java file that can be edited in a text editor or IDE

c)

Checking your code for syntax errors and putting it into a .class file

35.

What does System.out.print("Exam review") do?

a)

Prints the "Exam Review" to the printer.

b)

Prints "Exam Review" to the terminal followed by a carraige return/enter

c)

Prints "Exam Review" to the terminal and waits on the same line for the next command

d)

Prints "Exam Review" as the next line of code.

36.

What does System.out.println("Exam review") do?

a)

Prints the exam review to the printer.

b)

Prints "Exam Review" to the terminal followed by a carraige return/enter

c)

Prints "Exam Review" to the terminal and waits on the same line for the next command

d)

Prints "Exam Review" as the next line of code.

37.

Which of the following is NOT a relational operator?

a)

<

b)

>

c)

&&

d)

>=

38.

Which of the following is NOT an arithmetic operator?

a)

+

b)

%

c)

/

d)

=

e)

*

39.

In the import statements java.util.Scanner and java.util.Random, what does util stand for?

a)

until

b)

utopias

c)

utensils

d)

utility

40.

Which of the following correctly constructs a Scanner that reads from the terminal window?

a)

Scanner scan = new Scanner();

b)

Scanner scan = new Scanner(System.in);

c)

Scanner scan = new scan();

d)

Scanner scan = new Scanner(System.input);

41.

Assuming you have constructed a scanner named scan, how could you get just the number typed from the user?

a)

scan.next()

b)

scan.nextNumber()

c)

scan.nextInt()

d)

scan.nextLine()

42.

What keyword means that a method returns nothing?

a)

return

b)

parameters

c)

void

d)

public

43.

What keyword denotes the accessibility of the method to other classes?

a)

void

b)

public

c)

parameters

d)

return

44.

What keyword is used to have a method finish execution and send data back to its caller?

a)

void

b)

public

c)

return

d)

parameters

45.

What word means "the data sent to a method"?

a)

void

b)

public

c)

return

d)

parameters

46.

Smallest unit of data that is stored by a computer:

a)

Byte

b)

Binary code

c)

Bit

d)

Character

47.

Type of language that only includes zeros and ones:

a)

Java

b)

HTML

c)

Algebraic language

d)

Machine language

48.

The set of instructions that tell the computer what to do is generally known as:

a)

Hardware

b)

Software

c)

Bits

d)

Information

49.

The rules that must be followed to write a program on a specific computer language are known as:

a)

Grammar

b)

Syntax

c)

Precedence

d)

Directive

50.

An example of application software is:

a)

Mac OS

b)

HTML

c)

Java

d)

Word processor