Java Multiple Choice Questions and Answers

Wednesday, February 17, 2010

Which Control Statements allow the program to choose different paths of execution?

Selection

 

Which Control Statements enable program execution to repeat one or more statements?

Iteration

 

The switch statement does not require a break.

False

 

In Interface we need not use the keyword abstract for the methods.

True

 

What are the Logical operators?

OR(|) , AND(&) , XOR(^)

 

Byte can be Cast to Double Value.

True

 

Which thread is created automatically when the program is started?

Main thread

 

Nested if is less efficient then switch statement.

True

 

 ________ are stored in hierarchical manner.

Packages

 

The mechanism by which java frees the memory occupied by unused objects is ________.

Garbage Collection

 

When you implement an interface method, it must be declared as :-

Public

 

What are primitive data types?

byte, short, int, long

 

In While loop condition can be any Boolean expression

True

 

Long makes it useful when big ________ numbers are needed.

Whole

 

Which Control Statement allow the program to execute in a non-linear fashion?

Jump

 

With java Type Casts are checked at both compile-time and runtime.

True

 

Java defines two ways when instantiating an object, such as :-

Can implement the runnable interface , Can extend the thread class

 

The explicit drop of an object reference by setting the value of a variable, whose data type is a reference type of ________.

Null

 

What is a string?

A combination of characters called as string

 

What are the programming constructs?

Sequential , Selection -- if and switch statements , Iteration -- for loop, while loop and do-while loop

 

What can be created by instantiating an object type thread?

Thread

 

In ________ statement the value of the expression is compared with each of the literal values in case statements.

Switch

 

How to declare an interface example?

access class classname implements interface.

 

Integer can Cast to byte value.

False

 

Transient variable is variable that may not be serialized.

True

 

Using which keyword we can fully abstract a class?

interface

 

The ________ loop repeats a set of statements a certain number of times until a condition is matched.

For

 

There are ________ kinds of Floating point type

Two

 

By default, all program import the java.lang package.

True

 

What returns a reference to the thread in which it is called?

Method , Class , Object

 

Do while loop always executes its body at least once, because its conditional expression is at the bottom of the loop.

True

 

Which statements can be used with the java's loop?

Jump , Continue , Break

 

________ are containers for classes.

Packages

 

Java's multithreading system is built upon :-

Thread class , Its methods , Companion interface

 

The default encoding of objects supports the ________ of the classes.

Evolution

 

Which are the keywords use in switch statement?

Case , Default

 

A Java application can execute anywhere on the network, this implements that Java is :-

Architecture neutral

 

Boolean values can be cast into any other primitive type.

False

 

Which one does not extend java.lang.Number?

Boolean , Character

 

The smallest integer type is ________.

Byte

 

Which is a public static member of thread?

currenthread( ) , mainthread( )

 

Casting does not affect the original object or value.

True

 

Anything declared ________ can be accessed from anywhere within program.

Public

 

Which method is used to determine the class of an object?

getClass( ) method

 

Method definition has four parts, they are :-

Name of the method , Type of object , List of parameters

 

Object oriented programming organizes a program around processes acting on data.

False

 

What are the possible access modifiers while implementing interface methods?

public

 

Which statement defines a name space in which classes are stored?

package

 

Which statement is used to explicitly return from a method?

Return

 

There are two distinct types of multitasking. Which are those?

Process based , Thread-base

 

Exit statement is optional in which loops in java?

While , Do-while , For

 

 

Read more...

Chitika

About This Blog

Followers

  © Blogger template The Professional Template II by Ourblogtemplates.com 2009

Back to TOP