wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZ MS Core Java Quiz-3 2023

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

readLine() return / input which type of value by default?

a)

int

b)

float

c)

String

d)

All of the given

2.

Select TWO classes from io package.

a)

Scanner

b)

InputStreamReader

c)

String

d)

BufferedReader

3.

Give correct way of calling readLine().

a)

readLine();

b)

buffered_reader_object . readLine();

c)

scanner_object . readLine();

d)

None of the given

4.

parseInt() is used for?

a)

Input int

b)

Convert String to int

c)

Convert int to String

d)

Input String

5.

Apurva want to input her city name, which one is CORRECT?

a)

String city=Integer.parseInt(br_obj . readLine());

b)

String city=br_obj . readLine();

c)

String city=Integer.parseString(br_obj . readLine());

d)

String city=readLine());

6.

parseFloat() is used for?

a)

Input float

b)

Convert String to float

c)

Convert float to String

d)

Input String

7.

parseInt() is a _______________ .

a)

function

b)

class

c)

object

d)

package

8.

Pavan want to use readLine() to input his name? Which import statement he should write at the top of the program?

a)

import java.io.*;

b)

import java.util.*;

c)

import java.awt.*;

d)

Import java.io.*;

9.

class Demo

{

class_body;

main() function body;

}

By which name above program should be saved?

a)

Demo.java

b)

Demo.class

c)

class.Demo

d)

java.Demo

10.

Which is a correct way of compiling Demo.java program?

a)

javac Demo.java

b)

java Demo.java

c)

java Demo

d)

javac Demo

11.

When we compile Demo.java program we get Bytecode __________ .

a)

Demo.class

b)

Demo.java

c)

Demo