Wednesday, August 6, 2008

Java Programming - 9

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

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
The range of Byte is ________
Correct Answer
(-128 to 127)
Your Answer
(-128 to 127)

Match The Following
Question
Correct Answer
Your Answer
Subclass of the Exception
RuntimeException
RuntimeException
Access modifier
Public
Public
Variable in inetrface
Static type
Static type
Handle exceptions
Throws class
Throws class

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

True/False
Question
Suppose a given instance variable has been declared private, this instance variable is manipulated by methods outside its class.
Correct Answer
False
Your Answer
False

Select The Blank
Question
The most commonly used ________eger type is int.
Correct Answer
int
Your Answer
int

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

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 , Declare variable

Select The Blank
Question
Threads define several ________.
Correct Answer
constructors
Your Answer
constructors

Multiple Choice Single Answer
Question
Which class can be extended?
Correct Answer
threadclass
Your Answer
threadclass

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

Match The Following
Question
Correct Answer
Your Answer
Class
New data type
New data type
Passing by value
Methods - pass by value
Methods - pass by value
Passing by reference
Objects – pass by reference
Objects – pass by reference
Methods and variable
Members of class
Members of class

Select The Blank
Question
________ statement in java is conditional branch statement.
Correct Answer
If
Your Answer
If

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

Select The Blank
Question
When java program starts up, one thread begin runing and it is called ________thread.
Correct Answer
main( )
Your Answer
main( )

Select The Blank
Question
________ is an instance of the class.
Correct Answer
Object
Your Answer
Object

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

Select The Blank
Question
________ is an instance of a class that implements the runnable interface.
Correct Answer
threadOb
Your Answer
threadOb

True/False
Question
A thread's priority is used to decide when to switch from one running thread to the next, this is called as the context switch.
Correct Answer
True
Your Answer
True

Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Your Answer
Packages

Select The Blank
Question
________ are containers for classes.
Correct Answer
Packages
Your Answer
Packages

Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Your Answer
While , Do-while , For

Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer
Just-In-Time (JIT) compiler.
Your Answer
Just-In-Time (JIT) compiler.

Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
Your Answer
currenthread( ) , mainthread( )

True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Your Answer
True

Multiple Choice Single Answer
Question
A thread name can be obtained by caling which method?
Correct Answer
getName( )
Your Answer
getName( )

Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct Answer
public
Your Answer
public

Multiple Choice Multiple Answer
Question
Main thread is important for which two reasons?
Correct Answer
It is thread from which other "child" thread will be swapped , Often it must be the last thread to finish execution because It performs various shutdown actions
Your Answer
It is thread from which other "child" thread will be swapped , Often it must be the last thread to finish execution because It performs various shutdown actions

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

Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
Your Answer
package

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

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

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

Multiple Choice Multiple Answer
Question
When might your program wish to run the garbage collector?
Correct Answer
Before it enters a compute-intense section of code , Before it enters a memory-intense section of code , When it knows there will be some idle time
Your Answer
Before it enters a compute-intense section of code , Before it enters a memory-intense section of code , When it knows there will be some idle time

True/False
Question
Transient variable is variable that may not be serialized.
Correct Answer
True
Your Answer
True

True/False
Question
The for statement loop can be infinite.
Correct Answer
True
Your Answer
True

True/False
Question
A constructor is automatically called when an object is instantiated.
Correct Answer
True
Your Answer
True

True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Your Answer
True

Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Your Answer
Arithmetic , Bitwise , Relational

Multiple Choice Multiple Answer
Question
Java defines two ways when instantiating an object, such as :-
Correct Answer
Can implement the runnable interface , Can extend the thread class
Your Answer
Can implement the runnable interface , Can extend the thread class

Select The Blank
Question
A ________can implement more than one interface.
Correct Answer
Class
Your Answer
Class

Multiple Choice Single Answer
Question
If you do not implement all the methods of an interface while implementing, what specifier should you use for the class ?
Correct Answer
abtract
Your Answer
abtract

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
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: , String[ s]:

Multiple Choice Single Answer
Question
Which statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression?
Correct Answer
Switch
Your Answer
Switch

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

True/False
Question
Variable in an interface are implicitly final and static.
Correct Answer
True
Your Answer
True

No comments:

Search Assignments and Papers Here...


Custom Search

An Appeal to SCDL students

Dear SCDL Student,

We at http://scdlpapers.blogspot.com tries to collect and spread the knowledge in terms of the solved papers and assignments which we are getting through SCDL Alumni.
Now we request you to help other students through mutual sharing. Please send your assignment questions/papers to "mindgrill@gmail.com" . We will publish them on this blog along with your name.
Your help can be boon for many students to clear their exams.

Best of Luck and waiting for your contributions.

Team @ MindGrill