wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Feature

Total questions: 42

Worksheet time: 21mins

Name
Class
Date
1.

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

a)

JVM

b)

JDK

c)

JRE

d)

JIT

2.

Which component is responsible for converting bytecode into machine specific code

a)

JVM

b)

JDK

c)

JRE

d)

JIT

3.

Which component is responsible to run java program

a)

JVM

b)

JDK

c)

JRE

d)

JIT

4.

What is the extension of compiled java classes

a)

.classs

b)

.java

c)

.txt

d)

.js

5.

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

6.

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

7.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Use of pointers

d)

Object-oriented

8.

Java is ______________________

a)

Object based

b)

Object Oriented

c)

fully object oriented

d)

procedural

9.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Use of pointers

d)

Object-oriented

10.

(a)   is the logical blue print that describes how a object should behave.

11.

This keyword is used to mention that a method or variable belongs to a class and not to an individual object

(a)  

12.

Java is Completely Object Oriented Language

a)

True

b)

False

c)

Maybe

13.

Another name for Interpreter is?

a)

JDK

b)

JVM

c)

JRE

d)

SDK

14.

Java Source Code is converted to this form after compilation stage

a)

high level language

b)

Bytecode

c)

binary language

d)

machine la

15.

Which of these operators can be overloaded in java

a)

*

b)

/

c)

+

d)

-

16.

The wrapping of data and methods together is referred to as

a)

Abstraction

b)

Encapsulation

c)

Polymorphism

d)

Debugging

17.

The process of converting one data type to another explicitly is known as

a)

Case Sensitivity

b)

Polymorphism

c)

Casting

d)

Debugging

18.

Which keyword is used for bringing in a package and using its classes and methods

a)

include

b)

import

c)

public

d)

void

19.

Java has these following features ( Check all that apply)

a)

Robust

b)

Secure

c)

Sandbox

d)

Structured in nature

20.

Procedure oriented Programming is also known as modular programming.

a)

True

b)

False

21.

Which of the following is a limitation of procedure oriented programming paradigm.

a)

Data/variables can be declared as global.

b)

Data/variables can be declared as Local.

c)

Main Program can be divided into sub programs.

d)

Allow User defined functions.

22.

OOP allows decomposition of a problem into number of entities called

(a)  

23.

Which of the following is a part of Java Development Kit?

a)

Java runtime environment

b)

Java Development kit

c)

Java Virtual Machine

d)

All of them

24.

How many Bytes are reserved for "Char" data type in JAVA?

a)

1 Byte

b)

2 Bytes

c)

2 Bits

d)

14 Bits

25.

A Java file with extension .class contains

a)

Java source code

b)

HTML Tags

c)

Java Bytecodes

d)

A program file written in java programming language

26.

Which of the following is not a primitive data type of JAVA?

a)

int

b)

char

c)

String

d)

float

27.

Java is a platform independent programming language because

a)

It is written almost similar to English language

b)

Java compiler translates the source code directly to the machine level language.

c)

It follows the concept of “write once and compile everywhere”.

d)

It compiles to an intermediate code targeting a virtual machine, which can be interpreted by an interpreter for a given OS.

28.

So far the declaration of main() method is concerned, which of the following specification is not valid?

a)

void

b)

public

c)

private

d)

static

29.

Scanner inp= new Scanner(System.in);

What is System.in in this declaration?

a)

Any file storing data

b)

Reference to standard input device, that is, keyboard

c)

Reference to a scanner as an input device

d)

It is a mouse as an input device

30.

What is the output of following program?

class incr

{

public static void main(String args[])

{

int i=3;

System.out.println( ++i * 5);

}

}

(a)  

31.

Which of the following can not be used as correct variable name(identifier) in JAVA?

a)

malloc

b)

final

c)

calloc

d)

string

32.

Which of the following features are not common in both java and c++?

a)

The class declaration

b)

The access modifiers

c)

The Encapsulation of data and methods

d)

multiple inheritance from class

33.

Which among the following best describes encapsulation?

a)

It is a way of combining various data members into a single unit

b)

It is a way of combining various member functions into a single unit

c)

It is a way of combining various data members and member functions into a single unit which can operate on any data

d)

It is a way of combining various data members and member functions that operate on those data members into a single unit

34.

If data members are private, what can we do to access them from the class object?

a)

Create public member functions to access those data members

b)

Create private member functions to access those data members

c)

Create protected member functions to access those data members

d)

Private data members can never be accessed from outside the class

35.

Which feature can be implemented using encapsulation?

a)

Inheritance

b)

Abstraction

c)

Polymorphism

d)

Overloading

36.

Which inheritance in java programming is not supported

a)

Multiple inheritance

b)

hierarchal inheritance

c)

Multilevel inheritance

d)

Single inheritance

37.

What is subclass in java?

a)

A subclass is a class that extends another class

b)

A subclass is a class declared inside a class

c)

Both above.

d)

None of the above.

38.

If class B is subclassed from class A then which is the correct syntax

a)

class B:A{}

b)

class B extends A{}

c)

class B extends class A{}

d)

class B implements A{}

39.

Find which of the following uses encapsulation?

a)

void main(){

int a;

void fun() { int a=10;

System.out.println(a);

fun(); }

b)

class student{

int a;

public int b; };

c)

class student {

int a;

public void disp(){

System.out.println(a);

} }

d)

static topper() {

char name[10];

public int marks; }

40.

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

a)

super

b)

this

c)

extent

d)

extends

41.

Which among the following best defines abstraction?

a)

Hiding the implementation

b)

Showing the important data

c)

Hiding the important data

d)

Hiding the implementation and showing only the features

42.

If two classes combine some private data members and provides public member functions to access and manipulate those data members. Where is abstraction used?

a)

Using private access specifier for data members

b)

Using class concept with both data members and member functions

c)

Using public member functions to access and manipulate the data members

d)

Data is not sufficient to decide what is being used