wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java TEST

Total questions: 195

Worksheet time: 3hrs 23mins

Name
Class
Date
1.

It is used to store two types of values, i.e., true or false. This data type is commonly used as a flag in code logic.

a)

boolean

b)

byte

c)

char

d)

String

2.

It can store 8-bit signed two’s complement integer. The range lies between -128 to 127

a)

byte

b)

boolean

c)

char

d)

string

3.

This data type is used to store a single 16-bit Unicode character. It stores just one character in simple words, and the word Unicode is used because java uses the Unicode system, not the ASCII system. The size of this data type is 16bits (2 bytes).

a)

byte

b)

boolean

c)

char

d)

int

4.

It is a data type that stores 32 bit(4 bytes) two’s complement integer, i.e., its range lies within (-2^31 to 2^32 – 1).

a)

int

b)

float

c)

double

d)

String

5.

Similar to ‘int,’ it is also used to store integer values but within 16-bit (2 bytes) signed two’s complement. Its range lies within (-2^15 to 2^16-1).

a)

int

b)

long

c)

short

d)

byte

6.

It is 64 bit two’s complement integer and its range lies within (-2^63 to2^64 – 1) i.e. ( -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808).

a)

int

b)

short

c)

long

d)

byte

7.

It is a data type that holds data with more precision, i.e., floating-point numbers. It is a single-precision 32-bit (4 bytes) IEEE754 floating-point.

a)

int

b)

float

c)

double

d)

char

8.

It is a double-precision 64-bit (8 bytes) IEEE754 floating point.

a)

float

b)

double

c)

long

d)

int

9.

It is a sequence of characters.

a)

char

b)

string

c)

boolean

d)

int

10.

An element of a program that defines the type of data that a variable will hold

a)

variable

b)

expression

c)

operator

d)

data type

11.

Is "X" printed?

a)

YES

b)

NO

12.

Is "X" printed?

a)

YES

b)

NO

13.

Is "X" printed?

a)

YES

b)

NO

14.

Given : a = 1, b = 2

if ( missing ) print "X"


Select ALL expressions which can be used for missing to result in an "X" being printed.

a)

a < 2

b)

a != b

c)

a > b

d)

b >= a

e)

b == a

15.

Click ALL answers which result in an "X" printed.

a)

a = 3, b = 3, c = 3

b)

a = 5, b = 4, c = 7

c)

a = 1, b = 3, c = 5

d)

a = 6, b = 4, c = 3

e)

a = 5, b = 5, c = 3

16.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

17.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

18.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

19.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

20.

If x = 5 and y = 10, evaluate the following:


((x != 5) || (y == 9))

a)

True

b)

False

21.

4 % 6

a)

4

b)

6

c)

2

d)

3

22.

6 % 4

a)

4

b)

6

c)

2

d)

3

23.

int a = 7;

int b = 2 + a;

a)

b = 9

b)

b = 2

c)

b = 7

d)

b = 5

24.

int a = 5;

a++;

What is a now?

a)

4

b)

7

c)

5

d)

6

25.

int a = 5;

a--;

What is a now?

a)

4

b)

3

c)

5

d)

6

26.

What will print?

System.out.println( 1 / 4 );

a)

0

b)

0.25

c)

1

d)

4

27.

What will print?

System.out.println( 1.0 / 4 );

a)

0

b)

0.25

c)

1

d)

4

28.

What will print?

System.out.println( (double) 1 / 4 );

a)

0

b)

0.25

c)

1

d)

4

29.

int x = 4;

x *= 10;

Which is true?

a)

x is now 40

b)

x is now 10

c)

x is still 4

d)

x is now 14

30.

What is the value of b after this code segment?

int a = 4;

int b = a++;

a = a * 2;

b /= 2;

a)

2

b)

4

c)

5

d)

8

31.

What is output by the code? Pretend it says System.out.println

a)

2

b)

3

c)

4

d)

5

e)

6

32.

What is ouptut by the code? Pretend it says System.out.println

a)

2

b)

3

c)

4

d)

5

e)

6

33.

What is output by the code?

a)

123

b)

12

c)

1234

d)

12345

e)

4321

34.
a)

123

b)

12

c)

1234

d)

12345

e)

4321

35.

Pretend it says System.out.println

a)

1383

b)

83

c)

1813

d)

181383

e)

1318

36.
a)

1 2 4 8 16 32 64

b)

1 2 4 8 16 32

c)

2 4 8 16 32 64

d)

2 4 8 16 32

e)

4 8 16 32 64

37.
a)

200 66 22 7 2

b)

66 22 7 2

c)

200 66 22 2

d)

200 66 22

e)

7

38.

2

a)

5

b)

7

c)

9

d)

13

e)

20

39.
a)

-1 0 2 5

b)

-1 0 3 7

c)

-1 1 4 8

d)

0 2 5 9

e)

0 1 3 7

40.

A while loop carries on as long as...

a)

The condition in the brackets is true

b)

The condition in the brackets is false

c)

i < 10

d)

the for loop has not ended

41.

A while loop has the following format:

a)

while (condition)

{

...

}

b)

while

{

...

}

c)

continue while (condition)

{

...

}

d)

while [condition]

[

...;

]

42.

A condition in Javacould be any of the following:

a)

a >, <, ==, >=, <= relation

b)

str1.equals(str2)

c)

str1.equalsIgnoreCase(str2)

d)

str.length()

43.

While loops are used when ...

a)

You are not sure how many times exactly a loop should iterate

b)

You want a loop to repeat while the condition is true

c)

You don't like for loops

d)

You don't like to wait for things

44.

OUTPUT?

int i = 1;

while (i < 5) {

System.out.println("Hello");

i++;

}

a)

Hello

Hello

Hello

Hello

Hello

b)

Hello

Hello

Hello

Hello

c)

Hello

Hello

Hello

d)

Hello

45.

While loops are not really important or necessary in Java

a)

True

b)

False

46.

Write method header to Return a sales commission, given the sales amount and the commission rate

a)

public static double getCommission(double salesAmount)

b)

public static double getCommission(double salesAmount, double commissionRate)

c)

double getCommission(double salesAmount, double commissionRate)

d)

public static double(double salesAmount, double commissionRate)

47.

Write method header Display the calendar for a month, given the month and year

a)

public static void (int month, int year, int day)

b)

public static void printCalendar(int year)

c)

public static void printCalendar(int month, int year)

d)

void printCalendar(int month, int year)

48.

Write method header to Return a square root of a number

a)

public static void double sqrt(value)

b)

public static void double sqrt(double value)

c)

public static double sqrt(value)

d)

public static double sqrt(double value)

49.

Write method header to Display a message a specified number of times

a)

public static printMessage(int times, ntimes)

b)

public static void (String message, int times)

c)

public static void printMessage(String message, int times)

d)

public static void printMessage(int times)

50.

Write method header to Return the monthly payment, given the loan amount, number of years, and annual interest rate.

a)

public static monthlyPayment(double loan, int numberOfYears, double annualInterestRate)

b)

public static void double monthlyPayment(double loan, int numberOfYears, double annualInterestRate)

c)

public static double monthlyPayment()

d)

public static double monthlyPayment(double loan, int numberOfYears, double annualInterestRate)

51.

Write method header to Return the corresponding uppercase letter, given a lowercase letter

a)

public static char getUpperCase(char letter)

b)

public static void char getUpperCase(char letter)

c)

public static void getUpperCase(char letter)

d)

public static char getUpperCase()

52.

Java was developed by ...............

a)

Alan Tuning

b)

James Gosling

c)

Charles Babbage

d)

None of the above

53.

Earlier name of Java was ....................

a)

Coffee

b)

Tree

c)

Oak

d)

JavaScript

54.
Java Programming was designed by _________________
a)
Sun Microsystems
b)
Microsoft
c)
Mozilla Corporation
d)
Amazon Inc.
55.
Java was publicly released in _______________ .
a)
May 27, 1994
b)
May 27, 1995
c)
May 27, 1993
d)
May 27, 1992
56.
The first public implementation was _____________.
a)
Java 1.0
b)
Java 0.1
c)
Java Premium 1.0
d)
Java 1.1
57.
Java Programming promises programmer - "Write Once, Run Anywhere".
a)
false
b)
true
58.
Following file is human readable in Java programming language.
a)
.class
b)
.jar
c)
.obj
d)
.java
59.
Which of the following converts human readable file into platform independent code file in Java?
a)
Applet
b)
Compiler
c)
JRE
d)
JVM
60.
Platform independent code file created from Source file is understandable by _______________.
a)
Applet
b)
Compiler
c)
JRE
d)
JVM
61.
JVM Stands for __________________.
a)
Java Virtual Memory
b)
Java Virtual Management
c)
Java Virtual Machanism
d)
Java Virtual Machine
62.
JVM is a _____________ .
a)
Compiler
b)
Interpreter
c)
Assembler
d)
Debugger
63.

Which of the following is used to identify the Java Programming Language ?

a)

Map

b)

Sun

c)

Window

d)

Cup of Coffee

64.

Which of the following is NOT a data types in java

a)

int

b)

String

c)

number

d)

double

65.

What is right way of defining String variable?

a)

String name = "John";

b)

String name = "John"

c)

String name = John;

d)

String name "John";

66.

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

67.

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

68.

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"

69.

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

70.

Which of the following is assignment operator?

a)

==

b)

=

c)

=+

d)

++

71.

int x = 10;

x = x + 5;

System.out.println(x);


What will be the output?

a)

15

b)

5

c)

55

d)

x5

72.

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

73.

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

74.

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

75.

Which of these keywords is used to make a class?

a)

class

b)

struct

c)

int

d)

none of the mentioned

76.

What is the extension of compiled java classes?

a)

.java

b)

.class

c)

.txt

d)

.js

77.

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

a)

JVM

b)

JDK

c)

JIT

d)

JRE

78.

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

79.

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

a)

0

b)

Not a number

c)

Infinity

d)

Run time exception

80.
Which of these variables holds numbers with a decimal point?
a)
double
b)
int
c)
String
d)
boolean
81.
Which of these variables can hold only whole numbers?
a)
double
b)
int
c)
String
d)
boolean
82.
Which of these variables holds words or characters?
a)
double
b)
int
c)
String
d)
boolean
83.
Which of these variables holds a single character?
a)
double
b)
char
c)
String
d)
boolean
84.
Which of these variables holds true or false?
a)
double
b)
int
c)
String
d)
boolean
85.
An object from what class holds input from the user?
a)
System
b)
Scanner
c)
String
d)
Selena
86.
single line comments, which the computer doesn't read, start with
a)
//
b)
..
c)
**
d)
uppercase letters
87.
Which of these leaves the cursor on the same line as the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
88.
Which of these moves the cursor to the next line beneath the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
89.

Which means wild card, or 'all the things'?

a)

//

b)

!

c)

*

d)

wc

90.

Which line never changes?

a)

public static void main(String[] args){

b)

public class ThisGame{

c)

Scanner input = new Scanner(System.in);

d)

Boolean AndrewIsHere = false;

91.
Which type of data is used to enter the value ("Welcome")?
a)
Text
b)
Characters
c)
String
d)
Boolean
92.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
93.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
94.
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
95.
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();
96.

Which of the following class is used to read input during execution?

a)

Array

b)

String

c)

Scanner

d)

Main

97.

Which of the following is the best description of a "relational operator"?

a)

Comparison symbols used in logical expressions

b)

Mathematical symbols used to calculate numeric results

c)

Links that control the relationships between objects

d)

None of these are true

98.

Given two numbers A and B, which of the following expressions will be true when "A is less than B"?

a)

A < B

b)

A > B

c)

A == B

d)

A != B

99.

Given two numbers A and B, which of the following expressions will be true when "A is equal to B"?

a)

A != B

b)

A == B

c)

A = B

d)

A.eq(B)

100.

Given the following code, what will be displayed when the program is run?

int A = 5; int B = 10;

System.out.print(A != B);

System.out.print(" ");

System.out.print(A < B);

a)

true false

b)

false false

c)

true true

d)

false true

101.

Which of the following expressions (A, B, C) is considered a logical expression?

A) 6 + 4

B) (6 + 4) >= 10

C) 4 < 10

a)

A only

b)

B and C only

c)

A, B, and C

d)

C only

102.

What happens if you do not follow an if() statement with opening and closing curly braces?

a)

All following statements that are indented to the right are part of the if() body

b)

This is a compile-time syntax error

c)

You must follow immediately with another if() statement

d)

The next statement only is part of the if() body

103.

What is the difference between the following three if() statements?

double sodaCost = 2.50;

if (sodaCost > 2.00)

System.out.println("I'll have water instead");

if (sodaCost > 2.00)

System.out.println("I'll have water instead");

if (sodaCost > 2.00)

System.out.println("I'll have water instead");

a)

Only the second one is valid; the other two produce compile-time errors

b)

Impossible to tell without running the program

c)

The second two if() statements are nested inside the first and will only run if the first is true

d)

All three work exactly the same way and produce the same output

104.

Given the following boolean value, how would you write an if() statement that will execute if that value is true?

boolean run_me = true;

a)

All of these will work

b)

if (run_me)

c)

if (run_me == true)

d)

if (run_me != false)

105.

Given the following code, which of these if() statements will produce a compile-time error?

int value = 12;

a)

All of these are compile-time errors

b)

if (value = 13)

c)

if (value + 1)

d)

if (value += 5)

106.

What will be displayed when the following statements are run?

String pet = "cat";

if (pet.equals("dog")) {

System.out.println("WOOF"); }

if (pet.equals("dog") == false) {

System.out.println("MEOW"); }

a)

MEOW

b)

WOOF

c)

WOOF MEOW

d)

MEOW WOOF

107.

Given the if() / else if() code outlined below, when will the statements in the body of the "else if()" be run?

if () {

// body of if()

}

else if () {

// body of else if()

}

a)

When both logical expressions are true

b)

When logical expression 1 is false and logical expression 2 is true

c)

When logical expression 1 is true and logical expression 2 is false

d)

When both logical expressions are false

108.

Given the if() / else if() / else code outlined below, when will the statements in the body of the "else" be run?

if () { // body of if() }

else if () { // body of else if() }

else { // body of else }

a)

When logical expression 1 is false and logical expression 2 is true

b)

When both logical expressions are false

c)

When both logical expressions are true

d)

When logical expression 1 is true and logical expression 2 is false

109.

Given the nested if() code outlined below, when will the statements in the body of the inner "if()" be run?

if () {

if ()

{ // body of inner if() } }

a)

When logical expression 1 is false and logical expression 2 is true

b)

When both logical expressions are false

c)

When logical expression 1 is true and logical expression 2 is false

d)

When both logical expressions are true

110.

Given the code outlined below, how many output lines would be displayed if the program runs? if () { System.out.println("Line A"); return; } else { System.out.println("Line B"); return; } System.out.println("Line C");

a)

2 lines will always appear

b)

1 line will always appear

c)

3 lines will always appear

d)

It depends on the result of the logical expression

111.

Where is it permissible to add a nested if() statement?

a)

Inside the body of an "if()" block

b)

All of these are true

c)

Inside the body of an "else if()" block

d)

Inside the body of an "else" block

112.

When would you be more likely to use a chain of if() / else if() / else statements instead of a switch()?

a)

When your logic needs to test multiple variables

b)

When your logic needs to test multiple variables

c)

Both of these are true

d)

When your logic needs to test multiple variables

113.

In a switch() statement, what comes between the "case" keyword and the colon?

a)

An object reference

b)

A specific number, letter, or quoted-string value

c)

A logical expression

d)

A mathematical expression

114.

When the code below runs, what message will be displayed on the screen?

char grade = 'A';

switch(grade) {

case 'A':

System.out.println("90 - 100");

break;

case 'B':

System.out.println("80 - 89");

break;

case 'C':

System.out.println("70- 79");

break; }

a)

80 - 89

b)

90 - 100

c)

70 - 79

d)

Nothing will appear

115.

What happens in a switch() statement if you leave out the "break" statement between the first and second cases?

switch(value) {

case 1: // statements in first case

case 2: // statements in second case }

a)

Java will report a compile-time syntax error

b)

If the first case is a match, the program will flow through from that case and execute the second case body as well

c)

The program will only execute the statements in the first case

d)

The program will only execute the statements in the second case

116.

What message will appear on the screen when the following code is run?

String sport = "BASKETBALL";

switch (sport) {

case "basketball":

System.out.println("I love to play hoops");

break;

case "baseball":

System.out.println("My preferred position is pitcher");

break;

case "soccer":

System.out.println("I am a goal-scoring machine");

break;

default:

System.out.println("I've never played that sport");

break; }

a)

I've never played that sport

b)

I love to play hoops

c)

My preferred position is pitcher

d)

I am a goal-scoring machine

117.

Is "X" printed?

a)

YES

b)

NO

118.

Is "X" printed?

a)

YES

b)

NO

119.

Is "X" printed?

a)

YES

b)

NO

120.

Given : a = 1, b = 2

if ( missing ) print "X"


Select ALL expressions which can be used for missing to result in an "X" being printed.

a)

a < 2

b)

a != b

c)

a > b

d)

b >= a

e)

b == a

121.

Click ALL answers which result in an "X" printed.

a)

a = 3, b = 3, c = 3

b)

a = 5, b = 4, c = 7

c)

a = 1, b = 3, c = 5

d)

a = 6, b = 4, c = 3

e)

a = 5, b = 5, c = 3

122.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

123.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

124.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

125.

What output will be produced by the following segment of code?

a)

Too Low

b)

Too High

c)

Syntax Error

d)

No Output - Logic Error

126.

If x = 5 and y = 10, evaluate the following:


((x != 5) || (y == 9))

a)

True

b)

False

127.

What would the new value of A be?

A=1;

a++;

a)

1

b)

2

c)

3

d)

4

128.

What would the new value of A be?

A=1;

A--;

a)

0

b)

1

c)

2

d)

-1

129.

What's the value of below?


int i=5;


System.out.println(i);

System.out.println(++i);

a)

6

7

b)

67

c)

7

8

d)

5

6

130.

What does the following code output?

int x = 1;

System.out.println(x++);

a)

1

b)

2

c)

compilation error

d)

runtime error

131.

Which statement(s) are equivalent to i = i + 1?

a)

i += 1

b)

i++

c)

i -= 1

d)

i--

132.

What symbol represents the and operator in Java?

a)

AND

b)

and

c)

&

d)

&&

133.

What symbol represents the or operator in Java?

a)

OR

b)

or

c)

||

d)

|

134.
Which one of the following is NOT a logical operator?
a)
||
b)
&&
c)
$$
d)
!
135.

If a=2, b=5, c=3

Find result for : 8 * (a + b + c) – a % c

a)

80

b)

81

c)

77

d)

78

136.

int a = 2, b = 2, c = 0;

double d = 30.1;


Find answer for = (a > b) &&(( c <d) || (c!=a))

a)

35.9

b)

80

c)

true

d)

false

137.

It is a general programming language that is compatible for all computer system.

a)

Netbeans

b)

Visual Basic

c)

HTML

d)

Java

138.

He is the developer of Java programming language

a)

James Dosling

b)

James Gosling

c)

James Gostling

d)

James Gusling

139.

First java web browser

a)

Netscape Browser

b)

Hut Java

c)

Google

d)

Hot Java

140.

In 1800s, Island that is a main source and provider of coffee.

a)

Java Island

b)

Indonesia

c)

Bali, Island

d)

Java Programming

141.

Company of the creator of Java Programming Language

a)

Netscape Incorporated

b)

Sun Microsystem

c)

Sun System

d)

Nescape Incorporated

142.

Why James change the first name of programming language he created?

a)

He discovered that a programming language already

existed that was named Visual Basic.

b)

He discovered that a programming language already

existed that was named Java.

c)

He discovered that a programming language already

existed that was named Oak.

d)

He discovered that a programming language already

existed that was named Koa.

143.

Java program that runs in a Web browser

a)

Java system

b)

Java Application

c)

Java Servlet

d)

Java Applets

144.

In 1995, it is the Java web browser until it almost disappeared in 2002.

a)

Nescape Incorporated

b)

Java Programming Language

c)

Netscape Browser

d)

Java Applets

145.

Logo of Java Programming

a)
b)
c)
d)
146.

Company that uses oak operating system now.

a)

Nokia

b)

Samsung

c)

Huawei

d)

Apple

147.

It is used to store two types of values, i.e., true or false. This data type is commonly used as a flag in code logic.

a)

boolean

b)

byte

c)

char

d)

String

148.

It can store 8-bit signed two’s complement integer. The range lies between -128 to 127

a)

byte

b)

boolean

c)

char

d)

string

149.

This data type is used to store a single 16-bit Unicode character. It stores just one character in simple words, and the word Unicode is used because java uses the Unicode system, not the ASCII system. The size of this data type is 16bits (2 bytes).

a)

byte

b)

boolean

c)

char

d)

int

150.

It is a data type that stores 32 bit(4 bytes) two’s complement integer, i.e., its range lies within (-2^31 to 2^32 – 1).

a)

int

b)

float

c)

double

d)

String

151.

Similar to ‘int,’ it is also used to store integer values but within 16-bit (2 bytes) signed two’s complement. Its range lies within (-2^15 to 2^16-1).

a)

int

b)

long

c)

short

d)

byte

152.

It is 64 bit two’s complement integer and its range lies within (-2^63 to2^64 – 1) i.e. ( -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808).

a)

int

b)

short

c)

long

d)

byte

153.

It is a data type that holds data with more precision, i.e., floating-point numbers. It is a single-precision 32-bit (4 bytes) IEEE754 floating-point.

a)

int

b)

float

c)

double

d)

char

154.

It is a double-precision 64-bit (8 bytes) IEEE754 floating point.

a)

float

b)

double

c)

long

d)

int

155.

It is a sequence of characters.

a)

char

b)

string

c)

boolean

d)

int

156.

An element of a program that defines the type of data that a variable will hold

a)

variable

b)

expression

c)

operator

d)

data type

157.

What will be the output?

a)

A

b)

B

c)

C

158.

WHAT WILL BE THE OUTPUT?

a)

A

b)

B

c)

C

d)

D

159.

WHAT WILL BE THE OUTPUT?

a)

A

b)

B

c)

C

d)

D

160.
a)

A

b)

B

c)

C

d)

D

161.

WHAT WILL BE THE OUTPUT?

a)

A

b)

B

c)

C

d)

D

162.

What is output by the code? Pretend it says System.out.println

a)

2

b)

3

c)

4

d)

5

e)

6

163.

What is ouptut by the code? Pretend it says System.out.println

a)

2

b)

3

c)

4

d)

5

e)

6

164.

What is output by the code?

a)

123

b)

12

c)

1234

d)

12345

e)

4321

165.
a)

123

b)

12

c)

1234

d)

12345

e)

4321

166.

Pretend it says System.out.println

a)

1383

b)

83

c)

1813

d)

181383

e)

1318

167.
a)

1 2 4 8 16 32 64

b)

1 2 4 8 16 32

c)

2 4 8 16 32 64

d)

2 4 8 16 32

e)

4 8 16 32 64

168.
a)

200 66 22 7 2

b)

66 22 7 2

c)

200 66 22 2

d)

200 66 22

e)

7

169.

2

a)

5

b)

7

c)

9

d)

13

e)

20

170.
a)

-1 0 2 5

b)

-1 0 3 7

c)

-1 1 4 8

d)

0 2 5 9

e)

0 1 3 7

171.

Java is a

a)

Procedure Oriented Language

b)

Structure Oriented Language

c)

Object_Oriented Language

d)

Machine Language

172.

The name of the following should be the file name in Java

a)

Object Name

b)

Variable Nam

c)

Class Name

d)

Array Name

173.

Java program is

a)

Interpreted

b)

Compiled

174.

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

a)

Object file

b)

Array file

c)

Class file

d)

String file

175.

Command to compile Java program

a)

javax

b)

javay

c)

javac

d)

Java

176.

Command to run a Java program

a)

javaa

b)

java

c)

jaava

d)

jaavaa

177.

JDK stands for

a)

Java Developer Kit

b)

Java Development Kit

c)

Java Design Kit

d)

Java Debugging Kit

178.

JRE stands for

a)

Java Run Environment

b)

Java Run Execution

c)

Java Runtime Environment

d)

Java Ready Execution

179.

Java is

a)

Machine dependent language

b)

Machine independent language

180.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

181.
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();
182.

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

183.

JVM stands for

a)

Java Vital Machine

b)

Java Virtual Machine

c)

Java Vendor machine

184.

Java programs ________________

a)

are only compiled

b)

are only compiled not interpreted

c)

are only interpreted

d)

are both compiled and interpreted

185.

Main() method is not mandatory for a Java program

a)

True

b)

False

186.

Java Programming was designed by ______

a)

Sun MicroSystems

b)

Mozilla Corporation

c)

Microsoft

d)

Amazon Inc.

187.

Earlier name of Java Programming language was –

a)

Eclipse

b)

D

c)

Oak

d)

Netbean

188.

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

189.

Which of the following is not OOPS concept in Java?

a)

Inheritance

b)

Encapsulation

c)

Polymorphism

d)

Compilation

190.

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

a)

Polymorphism

b)

Encapsulation

c)

Abstraction

d)

Inheritance

191.

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

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Abstraction

192.

Java was developed in which year

a)

1992

b)

1993

c)

1994

d)

1995

193.

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

a)

JDK

b)

JRE

c)

JVM

d)

JIT

194.

The icon of Java program is taken from ___.

a)

a cup of coffee

b)

a tornado that spits fire

c)

a volcano under water

d)

a candle with a flame

195.

In Java EE, EE stands for ___.

a)

Entertainment Edition

b)

Entrepreneur Edition

c)

Enterprise Emperor

d)

Enterprise Edition