Saturday, January 16, 2010

Java Programming - 2

Java Programming - 2


LIST OF ATTEMPTED QUESTIONS AND ANSWERS

Multiple Choice Single Answer

Question Java's which system allows a thread to enter a synhcronized

method on an object, and then wait there until some other thread

explicitly notifies it to come out :-

Correct Answer Messaging

Your Answer Run time

Multiple Choice Multiple Answer

Question Packages act as containers for :-

Correct Answer Classes , Subordinate packages

Your Answer Subordinate packages , Classes

True/False

Question Threads priorities are not integers that specify the relative priority

of one thread to another.

Correct Answer False

Your Answer False

Multiple Choice Single Answer

Question When java program starts up, which thread begins running

immediately?

Correct Answer Main thread

Your Answer Main thread

Multiple Choice Single Answer

Question Java provides built-in support for which programming?

Correct Answer Multithreaded

Your Answer Multithreaded

Select The Blank

Question The ________ is similar to break, except that instead of halting

the execution of the loop, it starts the next iteration.

Correct Answer Continue

Your Answer Continue

Multiple Choice Single Answer

Question When can a constructor be called without specifying arguments?

Correct Answer When there are no constructors for the class

Your Answer When the default constructor is not called

Match The Following

Question Correct Answer Your Answer

Memory deallocation Garbage Collection Garbage Collection

This Current Object Current Object

Constructor Initialization object Initialization object

Parameters Method Generalized Method Generalized

Select The Blank

Question The mechanism which binds together the code and data and

keeps both safe is ________.

Correct Answer Encapsulation

Your Answer Encapsulation

Select The Blank

Question ________ is an instance of a class that implements the runnable

interface.

Correct Answer threadOb

Your Answer threadO

Multiple Choice Multiple Answer

Question Expression must be of the data types :-

Correct Answer Byte , Short , Int

Your Answer Byte , Short , Int , Boolean

True/False

Question Java define eight simple types of data byte, short, int, long, char,

float, double, boolean.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What modifiers may be used with top-level class?

Correct Answer Public , Abstract , Final

Your Answer Public , Abstract , Final

Multiple Choice Single Answer

Question Syntax to declare a variable in java is :-

Correct Answer type identifier [=value][,identifier[=value]…]

Your Answer type identifier [=value][,identifier[=value]…]

Select The Blank

Question ________ statement in java is conditional branch statement.

Correct Answer If

Your Answer If

Multiple Choice Single Answer

Question Which statement used inside a set of nested loops, will only break

out of the innermost loop?

Correct Answer Break

Your Answer Break

Select The Blank

Question In ________ statement condition is true, then statement 1 is

executed.

Correct Answer If

Your Answer If

Multiple Choice Multiple Answer

Question The source for the frist package defines three classes

Correct Answer Protection , Derived , SamePackage

Your Answer Protection , Derived , SamePackage

True/False

Question Java compiler stores the .class files in the path specified in

CLASSPATH environmental variable.

Correct Answer False

Your Answer True

True/False

Question Interface can be extended.

Correct Answer True

Your Answer True

Select The Blank

Question ________ is the logical construct upon which the entire java

language is built.

Correct Answer Class

Your Answer Class

True/False

Question Is it necessary to implement all the methods of an interface while

implementing the interface

Correct Answer False

Your Answer True

Multiple Choice Multiple Answer

Question Which loops can be nested in java?

Correct Answer While , Do-while , For

Your Answer While , Do-while , For

True/False

Question Float data type is useful when we need fractional values.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What all the run( ) method can do?

Correct Answer Can call other method , Declare variable

Your Answer Can call other method , Create object

True/False

Question Variable in an interface are implicitly final and static.

Correct Answer True

Your Answer True

Multiple Choice Single Answer

Question Which of the following operators are used in conjunction with the

this and super references?

Correct Answer The dot operator

Your Answer The dot operator

Select The Blank

Question The ________ keyword halts the execution of the current loop

and forces control out of the loop.

Correct Answer Break

Your Answer Break

Multiple Choice Single Answer

Question What is a data structure that controls the state of a collection of

threads as a whole?

Correct Answer Thread group

Your Answer Thread group

Multiple Choice Multiple Answer

Question By Providing the interface keyword, Java allows you to fully utilize

the which aspect of polymorphism?

Correct Answer One interface , Multiple methods

Your Answer One interface , Multiple methods , Derived

Select The Blank

Question For externalizable objects the ________ is solely responsible for

the external format of its contents.

Correct Answer Class

Your Answer Objects

Multiple Choice Multiple Answer

Question Which are the java's control statements?

Correct Answer For , If , Switch

Your Answer For , Switch , Continue

Multiple Choice Single Answer

Question What are the kinds of variables in Java?

Correct Answer Instance, local, class variables

Your Answer Instance, local, class variables

Multiple Choice Multiple Answer

Question Java Operators can be divided into these groups :-

Correct Answer Arithmetic , Bitwise , Relational

Your Answer Arithmetic , Bitwise , Relational

Match The Following

Question Correct Answer Your Answer

Interface Abtract method Abtract method

Pacakge declaration Package pkg Package pkg

Java.applet.Applet Class Applet Class Applet

Java.applet Java.applet package Java.applet package

Multiple Choice Single Answer

Question What is an array?

Correct Answer It is value collection of same type of data type

Your Answer It is value collection of same type of data type

Multiple Choice Multiple Answer

Question Modulus operator % can be applied to these data types :-

Correct Answer floating Point , Integer , Character

Your Answer floating Point , Integer

Select The Blank

Question Start( )executes a call to ________.

Correct Answer run( )

Your Answer run( )

Select The Blank

Question ________ is an instance of the class.

Correct Answer Object

Your Answer Object

Select The Blank

Question ________method starts a threrad by calling its run method.

Correct Answer start( )

Your Answer start( )

Multiple Choice Single Answer

Question Which Control Statements allow the program to choose different

paths of execution?

Correct Answer Selection

Your Answer Break

Multiple Choice Single Answer

Question Which Control Statements enable program execution to repeat

one or more statements?

Correct Answer Iteration

Your Answer Iteration

True/False

Question The switch statement does not require a break.

Correct Answer False

Your Answer True

True/False

Question In Interface we need not use the keyword abstract for the

methods.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What are the Logical operators?

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

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

True/False

Question Byte can be Cast to Double Value.

Correct Answer True

Your Answer False

Multiple Choice Multiple Answer

Question Which thread is created automatically when the program is

started?

Correct Answer Main thread

Your Answer Main thread , Current thread


Java Programming - 2

Java Programming - 2


LIST OF ATTEMPTED QUESTIONS AND ANSWERS

Multiple Choice Single Answer

Question Java's which system allows a thread to enter a synhcronized

method on an object, and then wait there until some other thread

explicitly notifies it to come out :-

Correct Answer Messaging

Your Answer Run time

Multiple Choice Multiple Answer

Question Packages act as containers for :-

Correct Answer Classes , Subordinate packages

Your Answer Subordinate packages , Classes

True/False

Question Threads priorities are not integers that specify the relative priority

of one thread to another.

Correct Answer False

Your Answer False

Multiple Choice Single Answer

Question When java program starts up, which thread begins running

immediately?

Correct Answer Main thread

Your Answer Main thread

Multiple Choice Single Answer

Question Java provides built-in support for which programming?

Correct Answer Multithreaded

Your Answer Multithreaded

Select The Blank

Question The ________ is similar to break, except that instead of halting

the execution of the loop, it starts the next iteration.

Correct Answer Continue

Your Answer Continue

Multiple Choice Single Answer

Question When can a constructor be called without specifying arguments?

Correct Answer When there are no constructors for the class

Your Answer When the default constructor is not called

Match The Following

Question Correct Answer Your Answer

Memory deallocation Garbage Collection Garbage Collection

This Current Object Current Object

Constructor Initialization object Initialization object

Parameters Method Generalized Method Generalized

Select The Blank

Question The mechanism which binds together the code and data and

keeps both safe is ________.

Correct Answer Encapsulation

Your Answer Encapsulation

Select The Blank

Question ________ is an instance of a class that implements the runnable

interface.

Correct Answer threadOb

Your Answer threadO

Multiple Choice Multiple Answer

Question Expression must be of the data types :-

Correct Answer Byte , Short , Int

Your Answer Byte , Short , Int , Boolean

True/False

Question Java define eight simple types of data byte, short, int, long, char,

float, double, boolean.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What modifiers may be used with top-level class?

Correct Answer Public , Abstract , Final

Your Answer Public , Abstract , Final

Multiple Choice Single Answer

Question Syntax to declare a variable in java is :-

Correct Answer type identifier [=value][,identifier[=value]…]

Your Answer type identifier [=value][,identifier[=value]…]

Select The Blank

Question ________ statement in java is conditional branch statement.

Correct Answer If

Your Answer If

Multiple Choice Single Answer

Question Which statement used inside a set of nested loops, will only break

out of the innermost loop?

Correct Answer Break

Your Answer Break

Select The Blank

Question In ________ statement condition is true, then statement 1 is

executed.

Correct Answer If

Your Answer If

Multiple Choice Multiple Answer

Question The source for the frist package defines three classes

Correct Answer Protection , Derived , SamePackage

Your Answer Protection , Derived , SamePackage

True/False

Question Java compiler stores the .class files in the path specified in

CLASSPATH environmental variable.

Correct Answer False

Your Answer True

True/False

Question Interface can be extended.

Correct Answer True

Your Answer True

Select The Blank

Question ________ is the logical construct upon which the entire java

language is built.

Correct Answer Class

Your Answer Class

True/False

Question Is it necessary to implement all the methods of an interface while

implementing the interface

Correct Answer False

Your Answer True

Multiple Choice Multiple Answer

Question Which loops can be nested in java?

Correct Answer While , Do-while , For

Your Answer While , Do-while , For

True/False

Question Float data type is useful when we need fractional values.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What all the run( ) method can do?

Correct Answer Can call other method , Declare variable

Your Answer Can call other method , Create object

True/False

Question Variable in an interface are implicitly final and static.

Correct Answer True

Your Answer True

Multiple Choice Single Answer

Question Which of the following operators are used in conjunction with the

this and super references?

Correct Answer The dot operator

Your Answer The dot operator

Select The Blank

Question The ________ keyword halts the execution of the current loop

and forces control out of the loop.

Correct Answer Break

Your Answer Break

Multiple Choice Single Answer

Question What is a data structure that controls the state of a collection of

threads as a whole?

Correct Answer Thread group

Your Answer Thread group

Multiple Choice Multiple Answer

Question By Providing the interface keyword, Java allows you to fully utilize

the which aspect of polymorphism?

Correct Answer One interface , Multiple methods

Your Answer One interface , Multiple methods , Derived

Select The Blank

Question For externalizable objects the ________ is solely responsible for

the external format of its contents.

Correct Answer Class

Your Answer Objects

Multiple Choice Multiple Answer

Question Which are the java's control statements?

Correct Answer For , If , Switch

Your Answer For , Switch , Continue

Multiple Choice Single Answer

Question What are the kinds of variables in Java?

Correct Answer Instance, local, class variables

Your Answer Instance, local, class variables

Multiple Choice Multiple Answer

Question Java Operators can be divided into these groups :-

Correct Answer Arithmetic , Bitwise , Relational

Your Answer Arithmetic , Bitwise , Relational

Match The Following

Question Correct Answer Your Answer

Interface Abtract method Abtract method

Pacakge declaration Package pkg Package pkg

Java.applet.Applet Class Applet Class Applet

Java.applet Java.applet package Java.applet package

Multiple Choice Single Answer

Question What is an array?

Correct Answer It is value collection of same type of data type

Your Answer It is value collection of same type of data type

Multiple Choice Multiple Answer

Question Modulus operator % can be applied to these data types :-

Correct Answer floating Point , Integer , Character

Your Answer floating Point , Integer

Select The Blank

Question Start( )executes a call to ________.

Correct Answer run( )

Your Answer run( )

Select The Blank

Question ________ is an instance of the class.

Correct Answer Object

Your Answer Object

Select The Blank

Question ________method starts a threrad by calling its run method.

Correct Answer start( )

Your Answer start( )

Multiple Choice Single Answer

Question Which Control Statements allow the program to choose different

paths of execution?

Correct Answer Selection

Your Answer Break

Multiple Choice Single Answer

Question Which Control Statements enable program execution to repeat

one or more statements?

Correct Answer Iteration

Your Answer Iteration

True/False

Question The switch statement does not require a break.

Correct Answer False

Your Answer True

True/False

Question In Interface we need not use the keyword abstract for the

methods.

Correct Answer True

Your Answer True

Multiple Choice Multiple Answer

Question What are the Logical operators?

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

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

True/False

Question Byte can be Cast to Double Value.

Correct Answer True

Your Answer False

Multiple Choice Multiple Answer

Question Which thread is created automatically when the program is

started?

Correct Answer Main thread

Your Answer Main thread , Current thread