wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IPT-QUIZ1

Total questions: 65

Worksheet time: 47mins

Name
Class
Date
1.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

2.

From where did Java get its name?

a)

Coffee

b)

Book

c)

TV Programme

d)

Initials of the developers of Java

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)

James Gosling

b)

Sergey Brin

c)

Steve Jobs

d)

Bill Gates

e)

Tim Berners-Lee

6.

What is the name of the Java mascot?

a)

Duke

b)

Ronny

c)

Penguin

d)

James

e)

Jack

7.

Which company owns Java?

a)

Oracle

b)

Microsoft

c)

Google

d)

Apple

e)

Intel

8.
Which type of data is used to enter the value ("Welcome")?
a)
Text
b)
Characters
c)
String
d)
Boolean
9.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
10.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
11.
We are 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
12.
We are use Random Library in java for...
a)
Choose a set of random numbers
b)
Deploy the program randomly
c)
Store a set of information at random
d)
All answers are correct
13.
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();
14.

which of the following is wrapper class in java

a)

Float

b)

Integer

c)

Double

d)

all of above

15.

which one of the following is a legal decelration of a two- dimensional array of integers

a)

int[] a[] = new int[5][];

b)

int[5][5] a = new int[][];

c)

int a = new int[5,5];

d)

int[][] a = new int[][5];

16.

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

17.

The keyword "method" is another name for

a)

an object

b)

a class

c)

a function

d)

a variable

18.

Which of the following is NOT a numeric data type

a)

int

b)

double

c)

float

d)

decimal

19.

Which of the following is incorrect?

a)

int count = 50.0;

b)

int salary = 50_000;

c)

int salary = 50_00;

d)

all of these are incorrect

20.

The numeric type int uses how many bits?

a)

31

b)

32

c)

63

d)

64

21.

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

a)

int count;

b)

String name;

c)

float gpa;

d)

char firstInitial;

22.

Where does a java program start executing instructions from:

a)

class

b)

source file

c)

main method

d)

object

23.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
24.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
25.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
26.
A variable that holds a decimal number
a)
String
b)
boolean
c)
int
d)
float
27.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
28.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
29.
These controls the behavior of a program.
a)
class
b)
object
c)
method
d)
void
30.
What does a comment look like in Java?
a)
//comment
b)
\\comment
c)
==comment
d)
\comment
31.

Which of the following is NOT a data types in java

a)

int

b)

String

c)

number

d)

double

32.

What is right way of defining String variable?

a)

String name = "John";

b)

String name = "John"

c)

String name = John;

d)

String name "John";

33.

float myFloatNum = 5.99f;

System.out.println(myFloatNum);


What will be the output?

a)

5.99

b)

5.99f

c)

"5.99"

d)

"5.99"f

34.

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

35.

Based on, the general rules for constructing names for variables.

Pick false statement.

a)

Names can contain letters, digits, underscores, and dollar signs.

b)

Names are NOT case sensitive

c)

Reserved words (like Java keywords, such as int or String) cannot be used as names

d)

Names can also begin with $ and _

36.

Which of the following is NOT a NON-primitive data type

a)

String

b)

Array

c)

double

d)

class

37.

which of the following is NOT a primitive data type?

a)

byte

b)

array

c)

char

d)

boolean

38.

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"

39.

int sum1 = 100 + 50;

int sum2 = sum1 + 250;

int sum3 = sum2 + sum2;

System.out.println(sum3);


What will be the final output?

a)

950

b)

800

c)

sum2sum2

d)

sum1250

40.

Which of the following is assignment operator?

a)

==

b)

=

c)

=+

d)

++

41.

int x = 10;

x = x + 5;

System.out.println(x);


What will be the output?

a)

15

b)

5

c)

55

d)

x5

42.

x /= 3


Which of the below statements matches with above statement?

a)

x = 3 / x

b)

x = x / 3

c)

x / 3

d)

x /x = 3

43.

int x = 4;

System.out.println(x < 5 && x < 10);


What will be the output?

a)

false

b)

true

c)

4

d)

x < 5 && x < 10

44.

int x = 4.4;

int y = 5.5;

System.out.println(x == y);


What will be the output?

a)

4.4

b)

true

c)

false

d)

5.5

45.

What is the output of below code?


int x = 5;

System.out.println(x++);

System.out.println(x);

a)

5

5

b)

6

6

c)

5

6

d)

6

5

46.

Which of the following option leads to the portability and security of Java?

a)

Bytecode is executed by JVM

b)

The applet makes the Java code secure and portable

c)

Use of exception handling

d)

Dynamic binding between objects

47.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Use of pointers

d)

Object-oriented

48.

_____ is used to find and fix bugs in the Java programs.

a)

JVM

b)

JRE

c)

JDK

d)

JDB

49.

Which of the following is a valid declaration of a char?

a)

char ch = '\utea';

b)

char ca = 'tea';

c)

char cr = \u0223;

d)

char cc = '\itea';

50.

What does the expression float a = 35 / 0 return?

a)

0

b)

Not a number

c)

Infinity

d)

Run time exception

51.

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

a)

24

b)

23

c)

20

d)

25

52.

Which of the following for loop declaration is not valid?

a)

for ( int i = 99; i >= 0; i / 9 )

b)

for ( int i = 7; i <= 77; i += 7 )

c)

for ( int i = 20; i >= 2; - -i )

d)

for ( int i = 2; i <= 20; i = 2* i )

53.

Which of the following is not OOPS concept in Java?

a)

Inheritance

b)

Encapsulation

c)

Polymorphism

d)

Compilation

54.

Which of the following is a type of polymorphism in Java?

a)

Compile time polymorphism

b)

Execution time polymorphism

c)

Multiple polymorphism

d)

Multilevel polymorphism

55.

When does method overloading is determined?

a)

At run time

b)

At compile time

c)

At coding time

d)

At execution time

56.

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

a)

Polymorphism

b)

Encapsulation

c)

Abstraction

d)

Inheritance

57.

Which concept of Java is achieved by combining methods and attribute into a class?

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Abstraction

58.

Which component is used to compile, debug and execute java program?

a)

JVM

b)

JDK

c)

JIT

d)

JRE

59.

Which of the below is invalid identifier with the main method?

a)

public

b)

static

c)

final

d)

private

60.

What is use of interpreter?

a)

They convert bytecode to machine language code

b)

They read high level code and execute them

c)

They are intermediated between JIT and JVM

d)

It is a synonym for JIT

61.

What is the extension of compiled java classes?

a)

.java

b)

.class

c)

.txt

d)

.js

62.

Which of these keywords is used to make a class?

a)

class

b)

struct

c)

int

d)

none of the mentioned

63.

Which of these statement is incorrect?

a)

Every class must contain a main() method

b)

Applets do not require a main() method at all

c)

There can be only one main() method in a program

d)

main() method must be made public

64.

Which of the following statements is correct?

a)

Public method is accessible to all other classes in the hierarchy

b)

Public method is accessible only to subclasses of its parent class

c)

Public method can only be called by object of its class

d)

Public method can be accessed by calling object of the public class

65.

Which of this keyword must be used to inherit a class?

a)

super

b)

this

c)

extend

d)

extends