wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Basics

Total questions: 27

Worksheet time: 9mins

Name
Class
Date
1.

What is the keyword "final" used for in Java?

a)

identify a constant

b)

identify an integer

c)

identify a string

d)

Identify a final answer

2.

The keyword "method" is another name for

a)

an object

b)

a class

c)

a function

d)

a variable

3.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

4.

Which of the following is NOT a numeric data type

a)

int

b)

double

c)

float

d)

decimal

5.

Where does a java program start executing instructions from:

a)

class

b)

source file

c)

main method

d)

object

6.

Which of the following is an example of a reference variable declaration?

a)

int count;

b)

String name;

c)

float gpa;

d)

char firstInitial;

7.
When we want to print in Java, we use the code ......
a)
system.out.print();
b)
System.out.println();
c)
System.Out.Printf();
d)
System.out.show();
8.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
9.
A variable that holds a decimal number
a)
String
b)
boolean
c)
int
d)
float
10.
These controls the behavior of a program.
a)
class
b)
object
c)
method
d)
void
11.

What is the main difference between float and double data types?

a)

4.1 is an example of float.

b)

4.11 is an example of double.

c)

Float consists of 8 bytes, and double consists of 4 bytes.

d)

Float consists of 4 bytes, and double consists of 8 bytes.

12.

What kind of data type is used for numbers?

a)

Integer

b)

String

c)

Boolean

d)

Floating Point

13.

What is a blueprint and determines how an object will behave?

a)

Object

b)

Method

c)

Attribute

d)

Class

14.

To make a particular type of data useful, you need to have properties and methods included in a self-contained component. This component also has a memory location allocated. What is it?

a)

Class

b)

Method

c)

Value

d)

Object

15.

Java program is

a)

Interpreted

b)

Compiled

16.

A ___________ file is created after successful compilation of a Java program.

a)

Object file

b)

Array file

c)

Class file

d)

String file

17.

Command to compile Java program

a)

javax

b)

javay

c)

javac

d)

Java

18.

Command to run a Java program

a)

javaa

b)

java

c)

jaava

d)

jaavaa

19.

JDK stands for

a)

Java Developer Kit

b)

Java Development Kit

c)

Java Design Kit

d)

Java Debugging Kit

20.

JRE stands for

a)

Java Run Environment

b)

Java Run Execution

c)

Java Runtime Environment

d)

Java Ready Execution

21.
When we want to print in Java, we use the code ......
a)
system.out.print();
b)
System.out.println();
c)
System.Out.Printf();
d)
System.out.show();
22.

In Java WORA stands for

a)

Write Once Recall Anywhere

b)

Write Once Return Anywhere

c)

Write Once Read Anywhere

d)

Write Once Run Anywhere

23.

JVM stands for

a)

Java Vital Machine

b)

Java Virtual Machine

c)

Java Vendor machine

24.

Java Programming was designed by ______

a)

Sun MicroSystems

b)

Mozilla Corporation

c)

Microsoft

d)

Amazon Inc.

25.

Which of the following personality is called as father of Java Programming language –

a)

Guido vom Russom

b)

Larry Page

c)

Bjarne Stroustrup

d)

James Gosling

26.

Which of the following is not OOPS concept in Java?

a)

Inheritance

b)

Encapsulation

c)

Polymorphism

d)

Compilation

27.

Which concept of Java is a way of converting real world objects in terms of class?

a)

Polymorphism

b)

Encapsulation

c)

Abstraction

d)

Inheritance