Wednesday, July 16, 2008

Java Programming - 5

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

Match The Following
Question
Correct Answer
Your Answer
Constructor
Initialization object
Protected
Parameters
Method Generalized
Method Generalized
Memory deallocation
Garbage Collection
Garbage Collection
This
Current Object
Current Object

Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct Answer
Packages
Your Answer
Packages

Multiple Choice Single Answer
Question
The argument to which specifies the delayperiod in milliseconds
Correct Answer
sleep( )
Your Answer
wait( )

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

Match The Following
Question
Correct Answer
Your Answer
Exit any loop
Break
Exit
If
Else
Else
Loop
While
While
Jump
Break, continue, return
Goto

True/False
Question
A thread can be preempted by a higher priority thread.
Correct Answer
True
Your Answer
True

Multiple Choice Multiple Answer
Question
Which of these lines of code will compile?
Correct Answer
short s = 20; , char c = 32; , double d = 1.4;
Your Answer
short s = 20; , char c = 32; , double d = 1.4;

Multiple Choice Single Answer
Question
How to declare an interface example?
Correct Answer
access class classname implements interface.
Your Answer
access interface name

Multiple Choice Single Answer
Question
Which statement has a the effect of "jumping out" of the switch statement?
Correct Answer
Break
Your Answer
Break

True/False
Question
There is no Global Variable in Java.
Correct Answer
True
Your Answer
False

Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Your Answer
getClass( ) method

Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
Your Answer
Extends , Synchronized , Sizeof

True/False
Question
Each class in java can have a finalizer method.
Correct Answer
True
Your Answer
False

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 Multiple Answer
Question
What are the programming constructs?
Correct Answer
Sequential , Selection -- if and switch statements , Iteration -- for loop, while loop and do-while loop
Your Answer
Sequential , Selection -- if and switch statements , Loop

Select The Blank
Question
Java defines ________ integer type.
Correct Answer
Four
Your Answer
Five

Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Your Answer
Distributed

Multiple Choice Single Answer
Question
How is it possible to use few methods of an interface in a class?
Correct Answer
By declaring the class as abstract
Your Answer
By declaring the class public

Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Your Answer
(+ +) , (+ =) , (- =)

Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Your Answer
start( )

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]…]

Multiple Choice Multiple Answer
Question
Which of the following is the declaration of an array of string objects?
Correct Answer
String[ ] s; , String [ ]s: , String[ s]:
Your Answer
String[ ] s; , String s[ ]:

True/False
Question
A thread can voluntarily relinquish control.
Correct Answer
False
Your Answer
True

Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Your Answer
Return

Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Your Answer
Short , Int , Boolean

Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Your Answer
Object is no longer referred to by any variable

Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
Your Answer
Three

Select The Blank
Question
________ method suspends a thread for some period of time.
Correct Answer
sleep( )
Your Answer
sleep( )

True/False
Question
Running threads can be suspended, which temporarily suspends its activity.
Correct Answer
True
Your Answer
True

Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
Your Answer
Classes , Classes , Subclasses

Select The Blank
Question
Long makes it useful when big ________ numbers are needed.
Correct Answer
Whole
Your Answer
Prime

Select The Blank
Question
The explicit drop of an object reference by setting the value of a variable, whose data type is a reference type of ________.
Correct Answer
Null
Your Answer
Null

Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
Your Answer
Declare variable , Create object , Create class

True/False
Question
Java assigns to each thread a priority that determines how that thread should be treated with respect to the others.
Correct Answer
True
Your Answer
True

True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
Your Answer
False

Multiple Choice Single Answer
Question
To import a class, what is a syntax used?
Correct Answer
import classname;
Your Answer
import classname;

Multiple Choice Multiple Answer
Question
Which are the java's control statements?
Correct Answer
For , If , Switch
Your Answer
For , If , Switch

Select The Blank
Question
________ loop repeats a statement or block while its controlling expressions is true.
Correct Answer
While
Your Answer
While

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 Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Your Answer
Sun Microsystems

True/False
Question
Java allows loops to be nested.
Correct Answer
True
Your Answer
True

Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Your Answer
Compiler

Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct Answer
Public
Your Answer
Public

True/False
Question
Do while loop always executes its body at least once, because its conditional expression is at the bottom of the loop.
Correct Answer
True
Your Answer
True

Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Your Answer
Case , Default , Jump

Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Your Answer
Boolean , Character

Select The Blank
Question
After calling start( ) NewThread, constructor returns to ________.
Correct Answer
main( )
Your Answer
main( )

No comments:

Post a Comment