wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Library Classes

Total questions: 114

Worksheet time: 1hrs 14mins

Name
Class
Date
1.

Which key word allocates memory dynamically during object creation.

(a)  

2.

Write a java statement to create an object named Galaxy of Samsung class.

(a)  

3.

Creating an object of a class is said to be -------------

(a)  

4.

Write a java statement to import Scanner class

(a)  

5.

An object is also called an (a)   of the class.

6.

Character is a (a)   class

7.

(a)   is a blue print of an object.

8.

Which is known as object factory?

(a)  

9.

State the package that contains the class Scanner

(a)  

10.

int x=5;

x+=x++;

System.out.println(x);

Write the output

(a)  

11.

Bluej is a __ based platform

a)

DOS

b)

CUI

c)

Window

d)

None

12.

Single line comment is represented by (a)  

13.

JVM is a ----------

a)

java Compiler

b)

java Interpreter

c)

both

d)

None

14.

The words which are preserved with the system are called --------

(a)  

15.

Byte code is the program in ------------- form.

(a)  

16.

Write the name of exit controlled loop.

(a)  

17.

Name of a Java Program

(a)  

18.

System.out.println(Math.cbrt(125)) will give output

(a)  

19.

System.out.println(Math.ceil(-12.5)) will give output

(a)  

20.

System.out.println(Math.floor(12.5)) will give output

(a)  

21.

System.out.println(Math.round(-12.5)) will give output

(a)  

22.

System.out.println(Character.toUpperCase('a')) will give output

(a)  

23.

for(i =10;i>=5;i-=2)

{

System.out.print("*");

}

will give output

(a)  

24.

for(i=1;i<=3;++i)

{

for(j=1;j<=3;++j)

{

System.out.print("*");

}

}

Print() will be executed how many times.

(a)  

25.

Procedure oriented programming gives importance to

a)

instruction only

b)

Data only

c)

Instructions and data both

d)

none of these

26.

POP mainly uses

a)

Top down approach

b)

Bottom up approach

c)

Top down and bottom of both

d)

None of these

27.

object oriented programming mainly

a)

top down approach

b)

Bottom up approach

c)

Both of these

d)

None of these

28.

An object belonging to particular class is known as __________ of class

a)

Interface

b)

instance

c)

Alias

d)

Member

29.

object that share same attributes and behavior are grouped together into an

a)

Instance

b)

interface

c)

class

d)

Alias

30.

________________is a technique wrapping both data and function together to keep them safe from unauthorized access and misuse

a)

Abstraction

b)

inheritance

c)

Polymorphism

d)

Encapsulation

31.

____________Is the feature by means of which one class acquire the property of another class

a)

Abstraction

b)

Inheritance

c)

Polymorphism

d)

Encapsulation

32.

The term oop stands for

a)

object oriented procedure

b)

object oriented packet

c)

object oriented programming

d)

object orientation procedure

33.

java applications are_________

a)

platform independent

b)

platform dependent

c)

do not need any platform to run

d)

cannot run on windows

34.

JVM stands for

a)

java virtual machine

b)

java video monitor

c)

java visual monitor

d)

java virtual monitor

35.

JRE stands for

a)

java runtime editor

b)

java runtime environment

c)

java runtime expression

d)

java runtime enabler

36.

java uses _______ for execution

a)

compiler interpreter

b)

compiler

c)

interpreter

d)

none

37.

The program that translates code written in high level language into machine code is called________

a)

assembler

b)

compiler

c)

linker

d)

none

38.

A program that translates an assembly language program into machine code is called____________

a)

assembler

b)

compiler

c)

interpreter

d)

none

39.

java is _______

a)

robust

b)

secure

c)

object oriented

d)

all of above

40.

java can be used to write_________

a)

stand alone application only

b)

internet applets

c)

both a and b

d)

none

41.

java applications can run on

a)

Windows

b)

unix

c)

mac

d)

All

42.

an object has _____

a)

attribute

b)

behaviour

c)

state

d)

all

43.

A class is _________

a)

object factory

b)

a specification of objects

c)

blueprint to create objects

d)

all

44.

____________ represents an entity in the real world with its identity and behavior

a)

class

b)

objects

c)

procedure

d)

function

45.

_____________is a template to create similar objects that share common characteristics and behavior

a)

a function

b)

an attribute

c)

a procedure

d)

a class

46.

the value of an object's_______ represents the state of the object

a)

methods

b)

procedure

c)

attribute

d)

classes

47.

The term objects and ____________are often interchangeable

a)

instance

b)

attribute

c)

behaviour

d)

state

48.

ASCII stands for______

a)

American standard code for information interchange

b)

American simulated code for information interchange

c)

American standard code for interchange of information

d)

American standard code for interaction of information

49.

ASCII is _____

a)

6 bit set of codes

b)

7 bit set of codes

c)

8 bit set of codes

d)

16 bit set of codes

50.

Extended ASCII is

a)

6 bit set of codes

b)

7 bit set of codes

c)

8 bit set of codes

d)

16 bit set of codes

51.

Which of the following is not a token?

a)

keyword

b)

operator

c)

identifier

d)

procedure

52.

Which of the following is a keyword?

a)

chracter

b)

object

c)

break

d)

attribute

53.

Which of the following is not a legal identifier?

a)

_age

b)

9thclass

c)

$Amount

d)

nullValue

54.

Which of the following is an invalid integer?

a)

1999

b)

1999 99

c)

1999999

d)

19

55.

Which of the following is not a character literal?

a)

'\t'

b)

"\t"

c)

't'

d)

all

56.

Which of the following punctuator is a statement Terminator in Java?

a)

;

b)

,

c)

.

d)

?

57.

Which of the following is not a primitive data type in Java?

a)

boolean

b)

float

c)

short

d)

class

58.

Which of the following is the size of a long data type in Java?

a)

32 bits

b)

48 bits

c)

64 bits

d)

none

59.

Which of the following is the size of a boolean data type in Java?

a)

1 bit

b)

2 byte

c)

16 bits

d)

boolean data type does not hold any space

60.

And operator taking only single operand for its operation is called

a)

unary operator

b)

ternary operator

c)

binary operator

61.

which one of the following is not a binary operator?

a)

AND

b)

==

c)

%

d)

!

62.

which one of the following is not a valid operator in java

a)

<=

b)

!=

c)

!==

d)

==

63.

the statement i=i+1 is equivalent to

a)

i++

b)

++i

c)

i+=1

d)

all

64.

for x=5 the statement sum = ++x + 8 evaluates to

a)

sum= 13

b)

sum = 15

c)

sum = 14

d)

sum = 16

65.

the statement (1>0) &&(1<0)

a)

0

b)

1

c)

false

d)

true

66.

the statement (1>0) || (1<0) evaluates to

a)

0

b)

1

c)

true

d)

false

67.

the statement (1==1)?1:0 evaluates to

a)

0

b)

1

c)

false

d)

true

68.

the expression 13/3 gives the output

a)

4

b)

3

c)

0

d)

1

69.

the expression 13%3 gives the output

a)

4

b)

2

c)

3

d)

1

70.

The statement System.out.println("six"+3+3); gives the output

a)

six 33

b)

33 six

c)

six 6

d)

6 six

71.

the expression 4+8%2 gives the output

a)

6

b)

8

c)

4

d)

none

72.

single line comments can be added using

a)

//

b)

/* */

c)

\\

d)

both a and b

73.

which keyword do you use do you include a class in your program?

a)

import

b)

export

c)

new

d)

include

74.

our default delimiter using scanner class is

a)

comma

b)

Whitespace

c)

colon

d)

there is no default delimiter

75.

which package would you import to display the date and time

a)

java.util

b)

java.io.*

c)

java.Date

d)

java.lang.*

76.

which package would you import for the Scanner class ?

a)

java.util.*

b)

java.io.*

c)

java.awt.*

d)

java.lang.*

77.

errors occurring program when

a)

the program does not run properly or does not execute at all

b)

the program produce an incorrect result

c)

syntax of programming language is not followed

d)

all of the above

78.

Which java package include math class

a)

java.io

b)

java.util

c)

java.lang

d)

java.sys

79.

Give the output of Math.sqrt(x); when x=9.0

a)

3

b)

3.0

c)

3.00

d)

all

80.

Give the output of Math.ceil(46.6)

a)

46.6

b)

47.0

c)

46.5

d)

all

81.

give the output of Math.abs(x); when x=-9.99

a)

-9.99

b)

0.99

c)

9.99

d)

none

82.

which of the following is a method to find the square root of a number

a)

FindSqureRoot(x)

b)

Math.Square(x)

c)

Sqrt(x)

d)

Math.sqrt(x)

83.

Give the output of Math.pow(2,0)

a)

0.0

b)

1.0

c)

2.0

d)

-1.0

84.

Math.random() returns a double value r such that

a)

0.0<= r <1.0

b)

0.0< r <=1.0

c)

0.0<= r <=1.0

d)

0.0<=r <1.0

85.

Give the output of Math.floor(46.6)

a)

46.5

b)

-46.0

c)

47.0

d)

46.0

86.

Collection of similar classes, interfaces and sub packages

a)

variable

b)

Interface

c)

packages

d)

class

87.

Define Subpackage

a)

class member of package

b)

interface member of package

c)

package within another package

d)

None

88.

API

a)

applet programming interface

b)

application programming interface

c)

all time program interterface

d)

None

89.

Uses of Packages

a)

easily maintained

b)

access protection

c)

avoid naming collision

d)

None

90.

package types

a)

user defined

b)

built-in package

c)

both

d)

none

91.

what is the Syntax to define or create a package?

a)

     package <package_name>

b)

     package <package_name>;

c)

import      package <package_name>;

d)

none

92.

___________ is a collection of prewritten packages, classes, and interfaces with their respective methods, fields and constructors.

a)

API package

b)

class

c)

interface

d)

user defined package

93.

what is syntax to import all the content of package?

a)

import package_name.class_name;

b)

import package_name.*;

c)

import pak1.pak2.pak3;

d)

None

94.

what is syntax to import a particular class of package?

a)

import class_name.*;

b)

import package_name.*;

c)

import pak1.pak2.pak3;

d)

import package_name.class_name;

95.

Access modifiers are

a)

public

b)

Default

c)

private

d)

protected

96.

which member of a class can be accessible by the child of it of the same package?

a)

public

b)

private

c)

defualt

d)

protected

97.

Which member of a class can be accessible by another class of the same package?

a)

public

b)

private

c)

default

d)

protected

98.

which member of a class can be accessible by the child class of another package?

a)

public

b)

private

c)

protected

d)

default

99.

which member of a class can be accessible by other member of the same class?

a)

public

b)

private

c)

defualt

d)

protected

100.

Access Modifier controls___________.

a)

whether other packages can use a particular field or invoke a particular method.

b)

whether other interfaces can use a particular field or invoke a particular method.

c)

whether other classes can use a particular field or invoke a particular method.

d)

None

101.

Name the package that contains the class Scanner

(a)  

102.

Which of the following is not a reserved word

a)

public

b)

private

c)

end

d)

none

103.

JVM is a --------------

(a)  

104.

(a)   convert source code to byte code.

105.

Who developed Java

(a)  

106.

Which Math function is used to find absolute value of the argument?

(a)  

107.

Java program executed by the web browser is (a)  

108.

Java language use both

a)

Compiler

b)

Interprerter

c)

Assembler

d)

DTP

109.

Math.round(2.1) will give (a)  

110.

Math.floor(-2.9) will give (a)  

111.

Math.ceil(-9.1) will give ----------

(a)  

112.

Which package automatically imported into our java program.?

(a)  

113.

(a)   operator allocates memory dynamically to an object.

114.

System.out.println(Character.isDigit(A)) will give (a)   as output.