Wednesday, August 6, 2008

Java Programming - 15

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

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 , New class

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

Multiple Choice Single Answer
Question: If omit the package statement, which names are put into
defualt pacakge?
Correct Answer: class
Your Answer: method

True/False
Question: The switch statement does not require a break.
Correct Answer: False
Your Answer: False

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: Exceptions

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 , It is current thread

Select The Blank
Question: For externalizable objects the ________ is solely
responsible for the external format of its contents.
Correct Answer: Class
Your Answer: Method

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

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

True/False
Question: A thread can be blocked when waiting for a resource.
Correct Answer: True
Your Answer: True

Multiple Choice Multiple Answer
Question: What are different modifiers?
Correct Answer: Private , Protected , Final
Your Answer: Private , Protected

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

Match The Following
Question Correct Answer Your Answer
The data, or variable, defined Instance variable. Instance variable.
within a class
General form of Cast (target--type)value (target--type)value
Determine the relationship that Relational Operator Relational Operator
The secondary versions of the Short-Circuit Logical Operators Logical Operator
Boolean AND and OR operators

True/False
Question: With java Type Casts are checked at both compile-time and
runtime.
Correct Answer: True
Your Answer: False

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 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 , Create
object

Multiple Choice Single Answer
Question: How many types of literals are there?
Correct Answer: Number literals, character literals, boolean
literals, string literals, etc.
Your Answer: Only boolean and string literals

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: Which of these lines of code will compile?
Correct Answer: short s = 20; , char c = 32; , double d = 1.4;
Your Answer: byte b = 128; , char c = 32;

Multiple Choice Single Answer
Question: How do you assign values to variables?
Correct Answer: By using the assignment operator =.
Your Answer: By using the assignment operator =.

Select The Blank
Question: ________ is the logical construct upon which the entire
java language is built.
Correct Answer: Class
Your Answer: Method

Multiple Choice Single Answer
Question: How multidimensional array is declared?
Correct Answer: int[4] [5];
Your Answer: int[4] [5];

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

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

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 memory-intense section of code ,
When it knows there will be some idle time , Before objects are finalized

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

Multiple Choice Single Answer
Question: What is a string?
Correct Answer: A combination of characters called as string
Your Answer: A combination of characters called as string

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

True/False
Question: Casting occurs commonly between numeric types
Correct Answer: True
Your Answer: False

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

True/False
Question: Integer can Cast to byte value.
Correct Answer: False
Your Answer: True

Match The Following
Question Correct Answer Your Answer
Derived class Subclass of protection Superclass
Class Interface Directories
Packages Directories Excpetion
Specifier Protected Protected

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

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: Anonymous classes be implemented in an ________.
Correct Answer: Interface
Your Answer: Interface

True/False
Question: Interface can be extended.
Correct Answer: True
Your Answer: False

Multiple Choice Multiple Answer
Question: There are two distinct types of multitasking. Which are
those?
Correct Answer: Process based , Thread-base
Your Answer: Process based , Thread-base

Multiple Choice Single Answer
Question: Java provides built-in support for which programming?
Correct Answer: Multithreaded
Your Answer: Multithreaded

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

True/False
Question: The switch differs from the if in that switch can only
test for equality, whereas if can evaluate any type of Boolean expression.
Correct Answer: True
Your Answer: True

Select The Blank
Question: ________ is referred by a variable candidate for garbage
collection when the variable goes out of scope.
Correct Answer: Objects
Your Answer: Class

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