Java Programming - 15
Question: Java defines two ways when instantiating an object, such as :-
Correct Answer: Can implement the runnable interface , Can extend
the thread class
True/False
Question: Java allows loops to be nested.
Correct Answer: True
Multiple Choice Single Answer
Question: If omit the package statement, which names are put into
defualt pacakge?
Correct Answer: class
True/False
Question: The switch statement does not require a break.
Correct 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
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
Select The Blank
Question: For externalizable objects the ________ is solely
responsible for the external format of its contents.
Correct Answer: Class
Multiple Choice Multiple Answer
Question: Which are keywords in Java?
Correct Answer: Extends , Synchronized , Sizeof
True/False
Question: Transient variable is variable that may not be serialized.
Correct Answer: True
True/False
Question: A thread can be blocked when waiting for a resource.
Correct Answer: True
Multiple Choice Multiple Answer
Question: What are different modifiers?
Correct Answer: Private , Protected , Final
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
Match The Following
Question- Correct Answer
The data, or variable, defined -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
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
Multiple Choice Multiple Answer
Question: What all the run( ) method can do?
Correct Answer: Can call other method , Declare variable
Multiple Choice Single Answer
Question: How many types of literals are there?
Correct Answer: Number literals, character literals, boolean
literals, string literals, etc.
Multiple Choice Single Answer
Question: What is an array?
Correct 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;
Multiple Choice Single Answer
Question: How do you assign values to variables?
Correct 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
Multiple Choice Single Answer
Question: How multidimensional array is declared?
Correct Answer: int[4] [5];
True/False
Question: The for statement loop can be infinite.
Correct Answer: True
Select The Blank
Question: ________ are stored in hierarchical manner.
Correct 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
Multiple Choice Multiple Answer
Question: Which of the following are mathematical Expressions?
Correct Answer: (+ +) , (+ =) , (- =)
Multiple Choice Single Answer
Question: What is a string?
Correct 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
True/False
Question: Casting occurs commonly between numeric types
Correct Answer: True
Select The Blank
Question: ________ is an instance of a class that implements the
runnable interface.
Correct Answer: threadOb
True/False
Question: Integer can Cast to byte value.
Correct Answer: False
Match The Following
Question -Correct 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
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
Select The Blank
Question: Anonymous classes be implemented in an ________.
Correct Answer: Interface
True/False
Question: Interface can be extended.
Correct Answer: True
Multiple Choice Multiple Answer
Question: There are two distinct types of multitasking. Which are
those?
Correct Answer: Process based , Thread-base
Multiple Choice Single Answer
Question: Java provides built-in support for which programming?
Correct Answer: Multithreaded
Multiple Choice Single Answer
Question: The argument to which specifies the delayperiod in
milliseconds
Correct 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
Select The Blank
Question: ________ is referred by a variable candidate for garbage
collection when the variable goes out of scope.
Correct Answer: Objects
Java Programming - 14
Select The Blank
Question: After calling start( ) NewThread, constructor returns to
________.
Correct Answer: main( )
True/False
Question: Nested if is less efficient then switch statement.
Correct Answer: True
Match The Following
Question -Correct Answer
Constructor -Initialization object
Parameters -Method Generalized
Memory deallocation -Garbage Collection
This -Current Object
Multiple Choice Multiple Answer
Question: Which thread is created automatically when the program is
started?
Correct Answer: Main thread
Select The Blank
Question: When java program starts up, one thread begin runing and
it is called ________thread.
Correct Answer: main( )
Multiple Choice Single Answer
Question: Multiple Choice Single Response
Correct Answer: Object oriented programming.
Multiple Choice Single Answer
Question: Which statement will always execute the body of a loop at
least once?
Correct Answer: Do
True/False
Question: In While loop condition can be any Boolean expression
Correct 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
True/False
Question: Short data type range is -30,376 to 32768.
Correct Answer: False
Multiple Choice Single Answer
Question: Which is a public static member of thread?
Correct Answer: Currenthread( )
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]:
Multiple Choice Multiple Answer
Question: There are two distinct types of multitasking. Which are
those?
Correct Answer: Process based , Thread-base
Select The Blank
Question: ________ is probably the least used java data type
Correct Answer: short
True/False
Question: Casting between primitive types allows conversion of one
primitive type to another.
Correct Answer: True
Multiple Choice Multiple Answer
Question: What are different modifiers?
Correct Answer: Private , Protected , Final
Multiple Choice Single Answer
Question: A Java application can execute anywhere on the network,
this implements that Java is :-
Correct Answer: Architecture neutral
Multiple Choice Single Answer
Question: Java Applets are intelligent programs means :-
Correct Answer: They can react to user input and dynamically change.
Select The Blank
Question: The name of the new thread is specified by ________.
Correct Answer: threadName
Select The Blank
Question: ________ is referred by a variable candidate for garbage
collection when the variable goes out of scope.
Correct Answer: Objects
Select The Blank
Question: The ________ repeat a set of code while the condition is
false.
Correct Answer: While loop
Multiple Choice Single Answer
Question: Select the facility provided along with JVM which enhances
speed of execution :-
Correct Answer: Just-In-Time (JIT) compiler.
Select The Blank
Question: ________ is an instance of the class.
Correct Answer: Object
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
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
Multiple Choice Multiple Answer
Question: Which are the keywords use in switch statement?
Correct Answer: Case , Default
Multiple Choice Single Answer
Question: The argument to which specifies the delayperiod in
milliseconds
Correct Answer: sleep( )
Multiple Choice Multiple Answer
Question: Which loops can be nested in java?
Correct Answer: While , Do-while , For
True/False
Question: If the break statement is omited in switch statement, then
execution will continue on into the next case.
Correct Answer: True
Match The Following
Question- Correct Answer
Exit any loop Break Exit
If -Else
Loop -While
Jump -Break, continue, return
Multiple Choice Single Answer
Question: To import a class, what is a syntax used?
Correct Answer: import classname;
Select The Blank
Question: The ________ keyword halts the execution of the current
loop and forces control out of the loop.
Correct Answer: Break
Multiple Choice Multiple Answer
Question: Java's multithreading system is built upon :-
Correct Answer: Thread class , Its methods , Companion interface
True/False
Question: When an object is referenced, it mean that it has been
identified by the finalizer method for garbage collection.
Correct Answer: False
Multiple Choice Single Answer
Question: Which Control Statements allow the program to choose
different paths of execution?
Correct Answer: Selection
Multiple Choice Multiple Answer
Question: Method definition has four parts, they are :-
Correct Answer: Name of the method , Type of object , List of
parameters
Select The Blank
Question: There are ________ kinds of Floating point type
Correct Answer: Two
Multiple Choice Multiple Answer
Question: What returns a reference to the thread in which it is
called?
Correct Answer: Method , Class , Object
Multiple Choice Single Answer
Question: Which statement defines a name space in which classes are
stored?
Correct Answer: package
Your Answer: objects
Select The Blank
Question: ________ is an instance of a class that implements the
runnable interface.
Correct Answer: threadOb
Multiple Choice Multiple Answer
Question: The Stack performs which two function?
Correct Answer: pop( ) , push( )
True/False
Question: The for statement loop can be infinite.
Correct Answer: True
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
Multiple Choice Multiple Answer
Question: Which one does not extend java.lang.Number?
Correct Answer: Boolean , Character
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
True/False
Question: Running threads can be suspended, which temporarily
suspends its activity.
Correct Answer: True
Multiple Choice Single Answer
Question: What are the possible access modifiers while implementing
interface methods?
Correct Answer: public
Java Programming - 13
Multiple Choice Multiple Answer
Question: When might your program wish to run the garbage collector?
Correct Answer: When it knows there will be some idle time , Before it enters a compute-intense section of code , Before it enters a memory-intense section of code
Match The Following
Question -Correct Answer
start( ) thread main
main thread child thread child thread
NewThread this new
sleep( ) milliseconds milliseconds
Multiple Choice Multiple Answer
Question: Expression must be of the data types :-
Correct Answer: Byte , Short , Int
Multiple Choice Single Answer
Question: What are members of the threads class?
Correct Answer: Method
Multiple Choice Multiple Answer
Question: What modifiers may be used with top-level class?
Correct Answer: Public , Abstract , Final
Select The Blank
Question: Start( )executes a call to ________.
Correct Answer: run( )
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
Match The Following
Question- Correct Answer
currentThread -member of thread
High priority -thread preemptive
getName- thread's name
isAlive- thread is still running
Multiple Choice Single Answer
Question: How do you assign values to variables?
Correct Answer: By using the assignment operator =.
Multiple Choice Single Answer
Question: Which of the following is used to get the value of the instance variables?
Correct Answer: Dot Notation
Multiple Choice Multiple Answer
Question: Which are the keywords use in switch statement?
Correct Answer: Case , Default
Multiple Choice Multiple Answer
Question: The source for the frist package defines three classes
Correct Answer: Protection , Derived , SamePackage
Multiple Choice Multiple Answer
Question: The Stack performs which two function?
Correct Answer: pop( ) , push( )
Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Select The Blank
Question: The ________ repeats a set of code at least once before the condition is tested.
Correct Answer: Do-while loop
Multiple Choice Single Answer
Question: What is a string?
Correct Answer: A combination of characters called as string
Multiple Choice Single Answer
Question: How multidimensional array is declared?
Correct Answer: int[4] [5];
Multiple Choice Single Answer
Question: A thread name can be obtained by caling which method?
Correct Answer: getName( )
True/False
Question: A thread can voluntarily relinquish control.
Correct Answer: False
Multiple Choice Single Answer
Question: Which cast must be used to convert a larger value into a smaller one?
Correct Answer: Explicit cast.
Multiple Choice Multiple Answer
Question: Modulus operator % can be applied to these data types :-
Correct Answer: floating Point , Integer , Character
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
True/False
Question: Integer can Cast to byte value.
Correct Answer: False
Multiple Choice Single Answer
Question: How many concrete classes can you have inside an interface?
Correct Answer: none
Multiple Choice Single Answer
Question: When java program starts up, which thread begins running immediately?
Correct Answer: Main thread
Multiple Choice Single Answer
Question: Which operator is used to create and concatenate string?
Correct Answer: Addition operator(+).
Select The Blank
Question: After calling start( ) NewThread, constructor returns to ________.
Correct Answer: main( )
Multiple Choice Single Answer
Question: How to change the values of the elements of the array?
Correct Answer: By using array subscript expression
Multiple Choice Single Answer
Question: How can class be imported from a package to a program?
Correct Answer: import java.packagename.classname
True/False
Question: Is it necessary to implement all the methods of an interface while implementing the interface
Correct Answer: False
Multiple Choice Single Answer
Question: A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer: Architecture neutral
True/False
Question: Interface can be extended.
Correct Answer: True
Select The Blank
Question: A class can only inherit a single ________.
Correct Answer: Superclass
Multiple Choice Multiple Answer
Question: Exit statement is optional in which loops in java?
Correct Answer: While , Do-while , For
True/False
Question: Java allows loops to be nested.
Correct Answer: True
Multiple Choice Single Answer
Question: What is an array?
Correct Answer: It is value collection of same type of data type
Select The Blank
Question: ________ loop repeats a statement or block while its controlling expressions is true.
Correct Answer: While
True/False
Question: A thread can be blocked when waiting for a resource.
Correct Answer: True
Select The Blank
Question: A ________ is declared by use of the class keyword.
Correct Answer: class
Select The Blank
Question: Double data type uses ________ to store a value
Correct Answer: 64 bits
Multiple Choice Multiple Answer
Question: Packages act as containers for :-
Correct Answer: Classes , Subordinate packages
Select The Blank
Question: The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer: Garbage Collection
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
Multiple Choice Single Answer
Question: How many types of literals are there?
Correct Answer: Number literals, character literals, boolean literals, string literals, etc.
Multiple Choice Single Answer
Question: How array is defined?
Correct Answer: int arr[];
Multiple Choice Single Answer
Question: What are primitive data types?
Correct Answer: byte, short, int, long
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]:
Dear Students,Welcome to the Symbiosis Center for Distance Learning(SCDL) blog. We are destined to help you those students of SCDL who are doing post graduate diplomas in management from Symbiosis Center for Distance Learning SCDL Pune. Here they can find solved assignments, exam related informations and guidance.Soon It will contain assignments for PGDBA, PGDIM, PGDHRM, PGDIB, PGDIT.
Thursday, October 27, 2011
Java Programming - 12
Java Programming - 12
Select The Blank
Question: The most commonly used ________eger type is int.
Correct Answer: int
Select The Blank
Question: The Process by which one object acquires properties of another object is ________.
Correct Answer: Inheritence
Multiple Choice Single Answer
Question: The easiest way to create a thread is to create a class that implements which interface?
Correct Answer: Runnable
Multiple Choice Single Answer
Question: What are the possible access modifiers while implementing interface methods?
Correct Answer: public
Multiple Choice Single Answer
Question: Which statement is used inside the switch to terminate a statement sequence?
Correct Answer: Break
Multiple Choice Single Answer
Question: Which statement is used to explicitly return from a method?
Correct Answer: Return
Select The Blank
Question: ________ is probably the least used java data type
Correct Answer: short
Select The Blank
Question: Java defines ________ Primitive type of data.
Correct Answer: Eight
True/False
Question: The switch statement does not require a break.
Correct Answer: False
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
Select The Blank
Question: The ________ keyword halts the execution of the current loop and forces control out of the loop.
Correct Answer: Break
True/False
Question: At any time, a thread can be terminated.
Correct Answer: True
Select The Blank
Question: Anonymous classes be implemented in an ________.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
True/False
Question: When you write finalize() method for your class, you are overriding a finalizer inherited from a super class.
Correct Answer: True
Multiple Choice Single Answer
Question: To import a class, what is a syntax used?
Correct Answer: import classname;
Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
True/False
Question: Boolean values can be cast into any other primitive type.
Correct Answer: False
Multiple Choice Single Answer
Question: Which method is used to determine the class of an object?
Correct Answer: getClass( ) method
Multiple Choice Single Answer
Question: The argument to which specifies the delayperiod in milliseconds
Correct Answer: sleep( )
Select The Blank
Question: ________can be extended.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Which are the java's control statements?
Correct Answer: For , If , Switch
True/False
Question: There is no Global Variable in Java.
Correct Answer: True
Select The Blank
Question: After the new thread is created, it will not start running until you call its ________method.
Correct Answer: start( )
Match The Following
Question -Correct Answer
The Operators used in mathematical -Arithmetic Operator
Order in which operators are evaluated -Order of precedence
Whether an expression is evaluated -Associativity
left-to-right or right-to-left.
Java operator syntax for -right (= operator;)
Multiple Choice Single Answer
Question: Which Control Statements enable program execution to repeat one or more statements?
Correct Answer: Iteration
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;
Multiple Choice Multiple Answer
Question: Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer: Classes , Subclasses , Packages
Multiple Choice Single Answer
Question: Syntax to declare a variable in java is :-
Correct Answer: type identifier [=value][,identifier[=value]…]
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
Multiple Choice Multiple Answer
Question: What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer: Classes , Packages , Subclasses
Multiple Choice Single Answer
Question: Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer: While
Multiple Choice Multiple Answer
Question: What are the Logical operators?
Correct Answer: OR() , AND(&) , XOR(^)
Multiple Choice Multiple Answer
Question: Which of the following assignments are valid?
Correct Answer: short s = 28; , double d = 2.3; , int I = '1';
Multiple Choice Multiple Answer
Question: Which one does not extend java.lang.Number?
Correct Answer: Boolean , Character
Select The Blank
Question: We can contruct a thread on any object that implements ________.
Correct Answer: Runnable
True/False
Question: Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer: False
True/False
Question: User-defined package can also be imported just like the standard packages.
Correct Answer: True
Multiple Choice Multiple Answer
Question: Which of the following are mathematical Expressions?
Correct Answer: (+ +) , (+ =) , (- =)
Match The Following
Question -Correct Answer
The data, or variable, defined within -Instance variable.
General form of Cast- (target--type)value
Determine the relationship that one -Relational Operator
operand has to the other
The secondary versions of the Boolean Logical Operators Logical Operator
AND and OR operators Short-Circuit
True/False
Question: A thread can be preempted by a higher priority thread.
Correct Answer: True
Select The Blank
Question: Java virtual machine works as ________ for the the bytecode.
Correct Answer: Interpreter
Select The Blank
Question: The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer: Encapsulation
True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
True/False
Question: With java Type Casts are checked at both compile-time and runtime.
Correct Answer: True
Multiple Choice Single Answer
Question: What are the kinds of variables in Java?
Correct Answer: Instance, local, class variables
Java Programming - 11
True/False
Question: Threads of equal priority must voluntarily yield control to their peers.
Correct Answer: True
Match The Following
Question -Correct Answer
The Operators used in -Arithmetic Operator
mathematical expressions- Order in which operators are Order of precedence
Whether an expression is Associativity (= operator;)-
evaluated left-to-right or
right-to-left.
Java operator syntax for right (= operator;) Comparison Operator
associativity
Multiple Choice Single Answer
Question: What can be created by instantiating an object type thread?
Correct Answer: Thread
Select The Blank
Question: ________method starts a threrad by calling its run method.
Correct Answer: start( )
Multiple Choice Single Answer
Question: How to declare an interface example?
Correct Answer: access class classname implements interface.
Multiple Choice Single Answer
Question: Multiple Choice Single Response
Correct Answer: Object oriented programming.
Select The Blank
Question: The name of the new thread is specified by ________.
Correct Answer: threadName
Multiple Choice Multiple Answer
Question: Java Operators can be divided into these groups :-
Correct Answer: Arithmetic , Bitwise , Relational
Multiple Choice Single Answer
Question: Which keyword is used to create an instance of a class?
Correct Answer: new
Multiple Choice Single Answer
Question: What are the kinds of variables in Java?
Correct Answer: Instance, local, class variables
Multiple Choice Single Answer
Question: Java was developed at :-
Correct Answer: Sun Microsystems
Select The Blank
Question: Java defines ________ Primitive type of data.
Correct Answer: Eight
Select The Blank
Question: There are ________ kinds of Floating point type
Correct Answer: Two
Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
Match The Following
Question -Correct Answer
It can have only one of two- Boolean type
possible values
Float hightemp, lowtemp Float variable declarations Float variable declarations
Smallest int type -Byte
Floating point numbers are Real Numbers Real Numbers
also known as
Select The Blank
Question: A ________ is a subclass of itself.
Correct Answer: Class
Select The Blank
Question: In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer: Switch
True/False
Question: If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer: True
Select The Blank
Question: The ________ loop is java's most fundamental looping statement.
Correct Answer: While
Multiple Choice Single Answer
Question: A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer: Architecture neutral
Select The Blank
Question: In ________ statement condition is true, then statement 1 is executed.
Correct Answer: If
Multiple Choice Single Answer
Question: Which statement will always execute the body of a loop at least once?
Correct Answer: Do
Multiple Choice Multiple Answer
Question: Which thread is created automatically when the program is started?
Correct Answer: Main thread
Multiple Choice Multiple Answer
Question: Which is a public static member of thread?
Correct Answer: currenthread( ) , mainthread( )
Multiple Choice Multiple Answer
Question: The Stack performs which two function?
Correct Answer: pop( ) , push( )
Multiple Choice Multiple Answer
Question: What returns a reference to the thread in which it is called?
Correct Answer: Method , Class , Object
True/False
Question: Is it necessary to implement all the methods of an interface while implementing the interface
Correct Answer: False
Multiple Choice Multiple Answer
Question: Modulus operator % can be applied to these data types :-
Correct Answer: floating Point , Integer , Character
Select The Blank
Question: The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer: For
Multiple Choice Single Answer
Question: Which statement has a the effect of "jumping out" of the switch statement?
Correct Answer: Break
True/False
Question: By default, all program import the java.lang package.
Correct Answer: True
Multiple Choice Single Answer
Question: Which Control Statements allow the program to choose different paths of execution?
Correct Answer: Selection
True/False
Question: A thread can voluntarily relinquish control.
Correct Answer: False
Select The Blank
Question: ________ statement in java is conditional branch statement.
Correct Answer: If
True/False
Question: As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer: True
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
True/False
Question: When an object is referenced, it mean that it has been identified by the finalizer method for garbage collection.
Correct Answer: False
Multiple Choice Single Answer
Question: Which cast must be used to cast an object to another class?
Correct Answer: Specific cast.
True/False
Question: Byte can be Cast to Double Value.
Correct Answer: True
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
Multiple Choice Single Answer
Question: When can a constructor be called without specifying arguments?
Correct Answer: When there are no constructors for the class
True/False
Question: Variable in an interface are implicitly final and static.
Correct Answer: True
True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Multiple Choice Multiple Answer
Question: Which are the two threads of java?
Correct Answer: mainthread( ) , childthread( )
Multiple Choice Multiple Answer
Question: Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer: Classes , Subclasses , Packages
Multiple Choice Single Answer
Question: Which method is used to determine the class of an object?
Correct Answer: getClass( ) method
Java Programming - 10
Select The Blank
Question: The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer: Garbage Collection
True/False
Question: Running threads can be suspended, which temporarily suspends its activity.
Correct Answer: True
Multiple Choice Single Answer
Question: Which Control Statements enable program execution to repeat one or more statements?
Correct Answer: Iteration
Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
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
Multiple Choice Single Answer
Question: Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer: Jump
Multiple Choice Single Answer
Question: Which class can be extended?
Correct Answer: threadclass
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
True/False
Question: Each class in java can have a finalizer method.
Correct Answer: True
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]:
Select The Blank
Question: Java virtual machine works as ________ for the the bytecode.
Correct Answer: Interpreter
True/False
Question: Constructors can be overloaded like regular methods.
Correct Answer: True
Match The Following
Question -Correct Answer
Methods- Member of Class
Stack First In, -Last Out First In,
Class Object- Oriented Programming
Object- Instance of Class
Multiple Choice Multiple Answer
Question: Java's multithreading system is built upon :-
Correct Answer: Thread class , Its methods , Companion interface
Multiple Choice Multiple Answer
Question: Which one does not extend java.lang.Number?
Correct Answer: Boolean , Character
Select The Blank
Question: The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer: Encapsulation
True/False
Question: There is no Global Variable in Java.
Correct Answer: True
True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Multiple Choice Multiple Answer
Question: Which loops can be nested in java?
Correct Answer: While , Do-while , For
True/False
Question: Threads priorities are not integers that specify the relative priority of one thread to another.
Correct Answer: False
Multiple Choice Single Answer
Question: How can class be imported from a package to a program?
Correct Answer: import java.packagename.classname
True/False
Question: When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer: True
Multiple Choice Single Answer
Question: To import a class, what is a syntax used?
Correct Answer: import classname;
Multiple Choice Multiple Answer
Question: Which are the java's control statements?
Correct Answer: For , If , Switch
Select The Blank
Question: The Process by which one object acquires properties of another object is ________.
Correct Answer: Inheritence
Select The Blank
Question: A ________ is declared by use of the class keyword.
Correct Answer: class
Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Multiple Choice Single Answer
Question: Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer: Just-In-Time (JIT) compiler.
Multiple Choice Multiple Answer
Question: Method definition has four parts, they are :-
Correct Answer: Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question: How many concrete classes can you have inside an interface?
Correct Answer: none
Multiple Choice Single Answer
Question: Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer: While
Multiple Choice Single Answer
Question: How to change the values of the elements of the array?
Correct Answer: By using array subscript expression
Multiple Choice Multiple Answer
Question: What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer: Classes , Packages , Subclasses
Match The Following
Question -Correct Answer
Exit any loop Break Exit
If -Else
Loop -While
Jump -Break, continue, return
True/False
Question: Casting between primitive types allows conversion of one primitive type to another.
Correct Answer: True
Select The Blank
Question: The smallest integer type is ________.
Correct Answer: Byte
Multiple Choice Single Answer
Question: class conditional { public static void main(String args[]) { int i = 20; int j = 55; int z = 0; z = i < j ? i : j; // ternary operator System.out.println("The value assigned is " + z); } } } What is output of the above program?
Correct Answer: The value assigned is 20
Select The Blank
Question: Multiple inheritance in Java can be achieve by ________.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Exit statement is optional in which loops in java?
Correct Answer: While , Do-while , For
Select The Blank
Question: The range of Byte is ________
Correct Answer: (-128 to 127)
True/False
Question: In While loop condition can be any Boolean expression
Correct Answer: True
Select The Blank
Question: When java program starts up, one thread begin runing and it is called ________thread.
Correct Answer: main( )
Select The Blank
Question: The ________ statement defines a name space in which classes are stored
Correct Answer: Packages
Multiple Choice Multiple Answer
Question: Packages act as containers for :-
Correct Answer: Classes , Subordinate packages
Multiple Choice Single Answer
Question: How array is defined?
Correct Answer: int arr[];
Multiple Choice Multiple Answer
Question: What modifiers may be used with top-level class?
Correct Answer: Public , Abstract , Final
Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
Select The Blank
Question: The most commonly used ________eger type is int.
Correct Answer: int
Select The Blank
Question: The Process by which one object acquires properties of another object is ________.
Correct Answer: Inheritence
Multiple Choice Single Answer
Question: The easiest way to create a thread is to create a class that implements which interface?
Correct Answer: Runnable
Multiple Choice Single Answer
Question: What are the possible access modifiers while implementing interface methods?
Correct Answer: public
Multiple Choice Single Answer
Question: Which statement is used inside the switch to terminate a statement sequence?
Correct Answer: Break
Multiple Choice Single Answer
Question: Which statement is used to explicitly return from a method?
Correct Answer: Return
Select The Blank
Question: ________ is probably the least used java data type
Correct Answer: short
Select The Blank
Question: Java defines ________ Primitive type of data.
Correct Answer: Eight
True/False
Question: The switch statement does not require a break.
Correct Answer: False
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
Select The Blank
Question: The ________ keyword halts the execution of the current loop and forces control out of the loop.
Correct Answer: Break
True/False
Question: At any time, a thread can be terminated.
Correct Answer: True
Select The Blank
Question: Anonymous classes be implemented in an ________.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
True/False
Question: When you write finalize() method for your class, you are overriding a finalizer inherited from a super class.
Correct Answer: True
Multiple Choice Single Answer
Question: To import a class, what is a syntax used?
Correct Answer: import classname;
Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
True/False
Question: Boolean values can be cast into any other primitive type.
Correct Answer: False
Multiple Choice Single Answer
Question: Which method is used to determine the class of an object?
Correct Answer: getClass( ) method
Multiple Choice Single Answer
Question: The argument to which specifies the delayperiod in milliseconds
Correct Answer: sleep( )
Select The Blank
Question: ________can be extended.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Which are the java's control statements?
Correct Answer: For , If , Switch
True/False
Question: There is no Global Variable in Java.
Correct Answer: True
Select The Blank
Question: After the new thread is created, it will not start running until you call its ________method.
Correct Answer: start( )
Match The Following
Question -Correct Answer
The Operators used in mathematical -Arithmetic Operator
Order in which operators are evaluated -Order of precedence
Whether an expression is evaluated -Associativity
left-to-right or right-to-left.
Java operator syntax for -right (= operator;)
Multiple Choice Single Answer
Question: Which Control Statements enable program execution to repeat one or more statements?
Correct Answer: Iteration
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;
Multiple Choice Multiple Answer
Question: Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer: Classes , Subclasses , Packages
Multiple Choice Single Answer
Question: Syntax to declare a variable in java is :-
Correct Answer: type identifier [=value][,identifier[=value]…]
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
Multiple Choice Multiple Answer
Question: What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer: Classes , Packages , Subclasses
Multiple Choice Single Answer
Question: Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer: While
Multiple Choice Multiple Answer
Question: What are the Logical operators?
Correct Answer: OR() , AND(&) , XOR(^)
Multiple Choice Multiple Answer
Question: Which of the following assignments are valid?
Correct Answer: short s = 28; , double d = 2.3; , int I = '1';
Multiple Choice Multiple Answer
Question: Which one does not extend java.lang.Number?
Correct Answer: Boolean , Character
Select The Blank
Question: We can contruct a thread on any object that implements ________.
Correct Answer: Runnable
True/False
Question: Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer: False
True/False
Question: User-defined package can also be imported just like the standard packages.
Correct Answer: True
Multiple Choice Multiple Answer
Question: Which of the following are mathematical Expressions?
Correct Answer: (+ +) , (+ =) , (- =)
Match The Following
Question -Correct Answer
The data, or variable, defined within -Instance variable.
General form of Cast- (target--type)value
Determine the relationship that one -Relational Operator
operand has to the other
The secondary versions of the Boolean Logical Operators Logical Operator
AND and OR operators Short-Circuit
True/False
Question: A thread can be preempted by a higher priority thread.
Correct Answer: True
Select The Blank
Question: Java virtual machine works as ________ for the the bytecode.
Correct Answer: Interpreter
Select The Blank
Question: The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer: Encapsulation
True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
True/False
Question: With java Type Casts are checked at both compile-time and runtime.
Correct Answer: True
Multiple Choice Single Answer
Question: What are the kinds of variables in Java?
Correct Answer: Instance, local, class variables
Java Programming - 11
True/False
Question: Threads of equal priority must voluntarily yield control to their peers.
Correct Answer: True
Match The Following
Question -Correct Answer
The Operators used in -Arithmetic Operator
mathematical expressions- Order in which operators are Order of precedence
Whether an expression is Associativity (= operator;)-
evaluated left-to-right or
right-to-left.
Java operator syntax for right (= operator;) Comparison Operator
associativity
Multiple Choice Single Answer
Question: What can be created by instantiating an object type thread?
Correct Answer: Thread
Select The Blank
Question: ________method starts a threrad by calling its run method.
Correct Answer: start( )
Multiple Choice Single Answer
Question: How to declare an interface example?
Correct Answer: access class classname implements interface.
Multiple Choice Single Answer
Question: Multiple Choice Single Response
Correct Answer: Object oriented programming.
Select The Blank
Question: The name of the new thread is specified by ________.
Correct Answer: threadName
Multiple Choice Multiple Answer
Question: Java Operators can be divided into these groups :-
Correct Answer: Arithmetic , Bitwise , Relational
Multiple Choice Single Answer
Question: Which keyword is used to create an instance of a class?
Correct Answer: new
Multiple Choice Single Answer
Question: What are the kinds of variables in Java?
Correct Answer: Instance, local, class variables
Multiple Choice Single Answer
Question: Java was developed at :-
Correct Answer: Sun Microsystems
Select The Blank
Question: Java defines ________ Primitive type of data.
Correct Answer: Eight
Select The Blank
Question: There are ________ kinds of Floating point type
Correct Answer: Two
Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
Match The Following
Question -Correct Answer
It can have only one of two- Boolean type
possible values
Float hightemp, lowtemp Float variable declarations Float variable declarations
Smallest int type -Byte
Floating point numbers are Real Numbers Real Numbers
also known as
Select The Blank
Question: A ________ is a subclass of itself.
Correct Answer: Class
Select The Blank
Question: In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer: Switch
True/False
Question: If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer: True
Select The Blank
Question: The ________ loop is java's most fundamental looping statement.
Correct Answer: While
Multiple Choice Single Answer
Question: A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer: Architecture neutral
Select The Blank
Question: In ________ statement condition is true, then statement 1 is executed.
Correct Answer: If
Multiple Choice Single Answer
Question: Which statement will always execute the body of a loop at least once?
Correct Answer: Do
Multiple Choice Multiple Answer
Question: Which thread is created automatically when the program is started?
Correct Answer: Main thread
Multiple Choice Multiple Answer
Question: Which is a public static member of thread?
Correct Answer: currenthread( ) , mainthread( )
Multiple Choice Multiple Answer
Question: The Stack performs which two function?
Correct Answer: pop( ) , push( )
Multiple Choice Multiple Answer
Question: What returns a reference to the thread in which it is called?
Correct Answer: Method , Class , Object
True/False
Question: Is it necessary to implement all the methods of an interface while implementing the interface
Correct Answer: False
Multiple Choice Multiple Answer
Question: Modulus operator % can be applied to these data types :-
Correct Answer: floating Point , Integer , Character
Select The Blank
Question: The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer: For
Multiple Choice Single Answer
Question: Which statement has a the effect of "jumping out" of the switch statement?
Correct Answer: Break
True/False
Question: By default, all program import the java.lang package.
Correct Answer: True
Multiple Choice Single Answer
Question: Which Control Statements allow the program to choose different paths of execution?
Correct Answer: Selection
True/False
Question: A thread can voluntarily relinquish control.
Correct Answer: False
Select The Blank
Question: ________ statement in java is conditional branch statement.
Correct Answer: If
True/False
Question: As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer: True
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
True/False
Question: When an object is referenced, it mean that it has been identified by the finalizer method for garbage collection.
Correct Answer: False
Multiple Choice Single Answer
Question: Which cast must be used to cast an object to another class?
Correct Answer: Specific cast.
True/False
Question: Byte can be Cast to Double Value.
Correct Answer: True
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
Multiple Choice Single Answer
Question: When can a constructor be called without specifying arguments?
Correct Answer: When there are no constructors for the class
True/False
Question: Variable in an interface are implicitly final and static.
Correct Answer: True
True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Multiple Choice Multiple Answer
Question: Which are the two threads of java?
Correct Answer: mainthread( ) , childthread( )
Multiple Choice Multiple Answer
Question: Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer: Classes , Subclasses , Packages
Multiple Choice Single Answer
Question: Which method is used to determine the class of an object?
Correct Answer: getClass( ) method
Java Programming - 10
Select The Blank
Question: The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer: Garbage Collection
True/False
Question: Running threads can be suspended, which temporarily suspends its activity.
Correct Answer: True
Multiple Choice Single Answer
Question: Which Control Statements enable program execution to repeat one or more statements?
Correct Answer: Iteration
Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
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
Multiple Choice Single Answer
Question: Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer: Jump
Multiple Choice Single Answer
Question: Which class can be extended?
Correct Answer: threadclass
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
True/False
Question: Each class in java can have a finalizer method.
Correct Answer: True
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]:
Select The Blank
Question: Java virtual machine works as ________ for the the bytecode.
Correct Answer: Interpreter
True/False
Question: Constructors can be overloaded like regular methods.
Correct Answer: True
Match The Following
Question -Correct Answer
Methods- Member of Class
Stack First In, -Last Out First In,
Class Object- Oriented Programming
Object- Instance of Class
Multiple Choice Multiple Answer
Question: Java's multithreading system is built upon :-
Correct Answer: Thread class , Its methods , Companion interface
Multiple Choice Multiple Answer
Question: Which one does not extend java.lang.Number?
Correct Answer: Boolean , Character
Select The Blank
Question: The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer: Encapsulation
True/False
Question: There is no Global Variable in Java.
Correct Answer: True
True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Multiple Choice Multiple Answer
Question: Which loops can be nested in java?
Correct Answer: While , Do-while , For
True/False
Question: Threads priorities are not integers that specify the relative priority of one thread to another.
Correct Answer: False
Multiple Choice Single Answer
Question: How can class be imported from a package to a program?
Correct Answer: import java.packagename.classname
True/False
Question: When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer: True
Multiple Choice Single Answer
Question: To import a class, what is a syntax used?
Correct Answer: import classname;
Multiple Choice Multiple Answer
Question: Which are the java's control statements?
Correct Answer: For , If , Switch
Select The Blank
Question: The Process by which one object acquires properties of another object is ________.
Correct Answer: Inheritence
Select The Blank
Question: A ________ is declared by use of the class keyword.
Correct Answer: class
Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Multiple Choice Single Answer
Question: Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer: Just-In-Time (JIT) compiler.
Multiple Choice Multiple Answer
Question: Method definition has four parts, they are :-
Correct Answer: Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question: How many concrete classes can you have inside an interface?
Correct Answer: none
Multiple Choice Single Answer
Question: Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer: While
Multiple Choice Single Answer
Question: How to change the values of the elements of the array?
Correct Answer: By using array subscript expression
Multiple Choice Multiple Answer
Question: What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer: Classes , Packages , Subclasses
Match The Following
Question -Correct Answer
Exit any loop Break Exit
If -Else
Loop -While
Jump -Break, continue, return
True/False
Question: Casting between primitive types allows conversion of one primitive type to another.
Correct Answer: True
Select The Blank
Question: The smallest integer type is ________.
Correct Answer: Byte
Multiple Choice Single Answer
Question: class conditional { public static void main(String args[]) { int i = 20; int j = 55; int z = 0; z = i < j ? i : j; // ternary operator System.out.println("The value assigned is " + z); } } } What is output of the above program?
Correct Answer: The value assigned is 20
Select The Blank
Question: Multiple inheritance in Java can be achieve by ________.
Correct Answer: Interface
Multiple Choice Multiple Answer
Question: Exit statement is optional in which loops in java?
Correct Answer: While , Do-while , For
Select The Blank
Question: The range of Byte is ________
Correct Answer: (-128 to 127)
True/False
Question: In While loop condition can be any Boolean expression
Correct Answer: True
Select The Blank
Question: When java program starts up, one thread begin runing and it is called ________thread.
Correct Answer: main( )
Select The Blank
Question: The ________ statement defines a name space in which classes are stored
Correct Answer: Packages
Multiple Choice Multiple Answer
Question: Packages act as containers for :-
Correct Answer: Classes , Subordinate packages
Multiple Choice Single Answer
Question: How array is defined?
Correct Answer: int arr[];
Multiple Choice Multiple Answer
Question: What modifiers may be used with top-level class?
Correct Answer: Public , Abstract , Final
Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
Java Programming - 9
Java Programming - 9
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
The range of Byte is ________
Correct Answer
(-128 to 127)
Match The Following
Question
Correct Answer
Subclass of the Exception
RuntimeException
Access modifier
Public
Variable in inetrface
Static type
Handle exceptions
Throws class
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct 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
Select The Blank
Question
The most commonly used ________eger type is int.
Correct Answer
int
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct 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
Select The Blank
Question
Threads define several ________.
Correct Answer
constructors
Multiple Choice Single Answer
Question
Which class can be extended?
Correct Answer
threadclass
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Match The Following
Question
Correct Answer
Class
New data type
Passing by value
Methods - pass by value
Passing by reference
Objects – pass by reference
Methods and variable
Members of class
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct Answer
If
True/False
Question
Java allows loops to be nested.
Correct Answer
True
Select The Blank
Question
When java program starts up, one thread begin runing and it is called ________thread.
Correct Answer
main( )
Select The Blank
Question
________ is an instance of the class.
Correct 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
Select The Blank
Question
________ is an instance of a class that implements the runnable interface.
Correct 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
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Select The Blank
Question
________ are containers for classes.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct 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.
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Single Answer
Question
A thread name can be obtained by caling which method?
Correct Answer
getName( )
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct 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
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct 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;
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
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct 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
True/False
Question
Transient variable is variable that may not be serialized.
Correct Answer
True
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
True/False
Question
A constructor is automatically called when an object is instantiated.
Correct Answer
True
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct 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
Select The Blank
Question
A ________can implement more than one interface.
Correct 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
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct 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]:
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
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
Variable in an interface are implicitly final and static.
Correct Answer
True
Java Programming - 8
True/False
Question
Nested if is less efficient then switch statement.
Correct Answer
True
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct Answer
Public
Multiple Choice Single Answer
Question
What are primitive data types?
Correct Answer
byte, short, int, long
True/False
Question
In While loop condition can be any Boolean expression
Correct Answer
True
Select The Blank
Question
Long makes it useful when big ________ numbers are needed.
Correct Answer
Whole
Multiple Choice Single Answer
Question
Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer
Jump
True/False
Question
With java Type Casts are checked at both compile-time and runtime.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following assignments are valid?
Correct Answer
short s = 28; , double d = 2.3; , int I = '1';
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
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
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
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
Multiple Choice Single Answer
Question
What can be created by instantiating an object type thread?
Correct Answer
Thread
Select The Blank
Question
In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer
Switch
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct Answer
access class classname implements interface.
True/False
Question
Integer can Cast to byte value.
Correct Answer
False
True/False
Question
Transient variable is variable that may not be serialized.
Correct Answer
True
Multiple Choice Single Answer
Question
Using which keyword we can fully abstract a class?
Correct Answer
interface
Select The Blank
Question
The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer
For
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
True/False
Question
By default, all program import the java.lang package.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , 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
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Match The Following
Question
Correct Answer
start( )
thread
main thread
child thread
NewThread
this
sleep( )
milliseconds
Select The Blank
Question
________ are containers for classes.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
Select The Blank
Question
The default encoding of objects supports the ________ of the classes.
Correct Answer
Evolution
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
True/False
Question
Boolean values can be cast into any other primitive type.
Correct Answer
False
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
The smallest integer type is ________.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
True/False
Question
Casting does not affect the original object or value.
Correct Answer
True
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer False
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct Answer
public
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Multiple Answer
Question
There are two distinct types of multitasking. Which are those?
Correct Answer
Process based , Thread-base
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Java Programming - 7
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
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
True/False
Question
Threads priorities are not integers that specify the relative priority of one thread to another.
Correct Answer
False
Multiple Choice Single Answer
Question
When java program starts up, which thread begins running immediately?
Correct Answer
Main thread
Multiple Choice Single Answer
Question
Java provides built-in support for which programming?
Correct 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
Multiple Choice Single Answer
Question
When can a constructor be called without specifying arguments?
Correct Answer
When there are no constructors for the class
Match The Following
Question
Correct Answer
Memory deallocation
Garbage Collection
This
Current Object
Constructor
Initialization object
Parameters
Method Generalized
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
Select The Blank
Question
________ is an instance of a class that implements the runnable interface.
Correct Answer
threadOb
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
True/False
Question
Java define eight simple types of data byte, short, int, long, char, float, double, boolean.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What modifiers may be used with top-level class?
Correct Answer
Public , Abstract , Final
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct Answer
type identifier [=value][,identifier[=value]…]
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct 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
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Multiple Answer
Question
The source for the frist package defines three classes
Correct Answer
Protection , Derived , SamePackage
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
True/False
Question
Interface can be extended.
Correct 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
Multiple Choice Multiple Answer
Question
Which loops can be nested in java?
Correct Answer
While , Do-while , For
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
True/False
Question
Variable in an interface are implicitly final and static.
Correct 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
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
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
Select The Blank
Question
For externalizable objects the ________ is solely responsible for the external format of its contents.
Correct Answer
Class
Multiple Choice Multiple Answer
Question
Which are the java's control statements?
Correct Answer
For , If , Switch
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Match The Following
Question
Correct Answer
Interface
Abtract method
Pacakge declaration
Package pkg
Java.applet.Applet
Class Applet
Java.applet
Java.applet package
Multiple Choice Single Answer
Question
What is an array?
Correct 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
Select The Blank
Question
Start( )executes a call to ________.
Correct Answer
run( )
Select The Blank
Question
________ is an instance of the class.
Correct Answer
Object
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Single Answer
Question
Which Control Statements allow the program to choose different paths of execution?
Correct Answer
Selection
Multiple Choice Single Answer
Question
Which Control Statements enable program execution to repeat one or more statements?
Correct 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
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
True/False
Question
Byte can be Cast to Double Value.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which thread is created automatically when the program is started?
Correct Answer
Main thread
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
The range of Byte is ________
Correct Answer
(-128 to 127)
Match The Following
Question
Correct Answer
Subclass of the Exception
RuntimeException
Access modifier
Public
Variable in inetrface
Static type
Handle exceptions
Throws class
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct 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
Select The Blank
Question
The most commonly used ________eger type is int.
Correct Answer
int
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct 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
Select The Blank
Question
Threads define several ________.
Correct Answer
constructors
Multiple Choice Single Answer
Question
Which class can be extended?
Correct Answer
threadclass
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Match The Following
Question
Correct Answer
Class
New data type
Passing by value
Methods - pass by value
Passing by reference
Objects – pass by reference
Methods and variable
Members of class
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct Answer
If
True/False
Question
Java allows loops to be nested.
Correct Answer
True
Select The Blank
Question
When java program starts up, one thread begin runing and it is called ________thread.
Correct Answer
main( )
Select The Blank
Question
________ is an instance of the class.
Correct 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
Select The Blank
Question
________ is an instance of a class that implements the runnable interface.
Correct 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
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Select The Blank
Question
________ are containers for classes.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct 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.
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Single Answer
Question
A thread name can be obtained by caling which method?
Correct Answer
getName( )
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct 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
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct 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;
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
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct 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
True/False
Question
Transient variable is variable that may not be serialized.
Correct Answer
True
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
True/False
Question
A constructor is automatically called when an object is instantiated.
Correct Answer
True
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct 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
Select The Blank
Question
A ________can implement more than one interface.
Correct 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
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct 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]:
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
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
Variable in an interface are implicitly final and static.
Correct Answer
True
Java Programming - 8
True/False
Question
Nested if is less efficient then switch statement.
Correct Answer
True
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct Answer
Public
Multiple Choice Single Answer
Question
What are primitive data types?
Correct Answer
byte, short, int, long
True/False
Question
In While loop condition can be any Boolean expression
Correct Answer
True
Select The Blank
Question
Long makes it useful when big ________ numbers are needed.
Correct Answer
Whole
Multiple Choice Single Answer
Question
Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer
Jump
True/False
Question
With java Type Casts are checked at both compile-time and runtime.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following assignments are valid?
Correct Answer
short s = 28; , double d = 2.3; , int I = '1';
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
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
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
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
Multiple Choice Single Answer
Question
What can be created by instantiating an object type thread?
Correct Answer
Thread
Select The Blank
Question
In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer
Switch
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct Answer
access class classname implements interface.
True/False
Question
Integer can Cast to byte value.
Correct Answer
False
True/False
Question
Transient variable is variable that may not be serialized.
Correct Answer
True
Multiple Choice Single Answer
Question
Using which keyword we can fully abstract a class?
Correct Answer
interface
Select The Blank
Question
The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer
For
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
True/False
Question
By default, all program import the java.lang package.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , 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
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Match The Following
Question
Correct Answer
start( )
thread
main thread
child thread
NewThread
this
sleep( )
milliseconds
Select The Blank
Question
________ are containers for classes.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
Select The Blank
Question
The default encoding of objects supports the ________ of the classes.
Correct Answer
Evolution
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
True/False
Question
Boolean values can be cast into any other primitive type.
Correct Answer
False
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
The smallest integer type is ________.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
True/False
Question
Casting does not affect the original object or value.
Correct Answer
True
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer False
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct Answer
public
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Multiple Answer
Question
There are two distinct types of multitasking. Which are those?
Correct Answer
Process based , Thread-base
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Java Programming - 7
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
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
True/False
Question
Threads priorities are not integers that specify the relative priority of one thread to another.
Correct Answer
False
Multiple Choice Single Answer
Question
When java program starts up, which thread begins running immediately?
Correct Answer
Main thread
Multiple Choice Single Answer
Question
Java provides built-in support for which programming?
Correct 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
Multiple Choice Single Answer
Question
When can a constructor be called without specifying arguments?
Correct Answer
When there are no constructors for the class
Match The Following
Question
Correct Answer
Memory deallocation
Garbage Collection
This
Current Object
Constructor
Initialization object
Parameters
Method Generalized
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
Select The Blank
Question
________ is an instance of a class that implements the runnable interface.
Correct Answer
threadOb
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
True/False
Question
Java define eight simple types of data byte, short, int, long, char, float, double, boolean.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What modifiers may be used with top-level class?
Correct Answer
Public , Abstract , Final
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct Answer
type identifier [=value][,identifier[=value]…]
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct 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
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Multiple Answer
Question
The source for the frist package defines three classes
Correct Answer
Protection , Derived , SamePackage
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
True/False
Question
Interface can be extended.
Correct 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
Multiple Choice Multiple Answer
Question
Which loops can be nested in java?
Correct Answer
While , Do-while , For
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
True/False
Question
Variable in an interface are implicitly final and static.
Correct 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
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
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
Select The Blank
Question
For externalizable objects the ________ is solely responsible for the external format of its contents.
Correct Answer
Class
Multiple Choice Multiple Answer
Question
Which are the java's control statements?
Correct Answer
For , If , Switch
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Match The Following
Question
Correct Answer
Interface
Abtract method
Pacakge declaration
Package pkg
Java.applet.Applet
Class Applet
Java.applet
Java.applet package
Multiple Choice Single Answer
Question
What is an array?
Correct 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
Select The Blank
Question
Start( )executes a call to ________.
Correct Answer
run( )
Select The Blank
Question
________ is an instance of the class.
Correct Answer
Object
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Single Answer
Question
Which Control Statements allow the program to choose different paths of execution?
Correct Answer
Selection
Multiple Choice Single Answer
Question
Which Control Statements enable program execution to repeat one or more statements?
Correct 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
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
True/False
Question
Byte can be Cast to Double Value.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which thread is created automatically when the program is started?
Correct Answer
Main thread
Java Programming - 6
Java Programming - 6
Select The Blank
Question
The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer
For
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
Multiple Choice Single Answer
Question
Which operator is used to create and concatenate string?
Correct Answer
Addition operator(+).
Multiple Choice Single Answer
Question
If omit the package statement, which names are put into defualt pacakge?
Correct Answer
class
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Multiple Choice Multiple Answer
Question
Classes usually consist of two things such as :-
Correct Answer
Instance variable , Methods
True/False
Question
In Interface we need not use the keyword abstract for the methods.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What modifiers may be used with top-level class?
Correct Answer
Public , Abstract , Final
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Single Answer
Question
What is an array?
Correct Answer
It is value collection of same type of data type
True/False
Question
The switch statement does not require a break.
Correct Answer
False
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
Multiple Choice Single Answer
Question
Which class can be extended?
Correct Answer
threadclass
Select The Blank
Question
________ variables are declared by use of the Byte Keyword.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Match The Following
Question
Correct Answer
For statement
Initialization, condition, iteration
Multi way branch statement
Switch statement
To terminate the statement
Break
Iteration statement
Do while
Multiple Choice Single Answer
Question
Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer
While
Select The Blank
Question
The Process by which one object acquires properties of another object is ________.
Correct Answer
Inheritence
Multiple Choice Single Answer
Question
Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer
Jump
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
True/False
Question
Casting between primitive types allows conversion of one primitive type to another.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
True/False
Question
Variable in an interface are implicitly final and static.
Correct Answer
True
Multiple Choice Multiple Answer
Question
When might your program wish to run the garbage collector?
Correct Answer
When it knows there will be some idle time , Before it enters a compute-intense section of code , Before it enters a memory-intense section of code
Multiple Choice Single Answer
Question
How to change the values of the elements of the array?
Correct Answer
By using array subscript expression
Multiple Choice Single Answer
Question
Which of the following is used to get the value of the instance variables?
Correct Answer
Dot Notation
True/False
Question
Integer can Cast to byte value.
Correct Answer
False
Select The Blank
Question
________ is an instance of the class.
Correct Answer
Object
Match The Following
Question
Correct Answer
Subclass of the Exception
RuntimeException
Access modifier
Public
Variable in inetrface
Static type
Handle exceptions
Throws class
True/False
Question
Casting occurs commonly between numeric types
Correct Answer
True
True/False
Question
If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer
True
Select The Blank
Question
Multiple inheritance in Java can be achieve by ________.
Correct Answer
Interface
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Single Answer
Question
What are members of the threads class?
Correct Answer
Method
Multiple Choice Single Answer
Question
How do you assign values to variables?
Correct Answer
By using the assignment operator =.
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
True/False
Question
As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer
True
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
Select The Blank
Question
After the new thread is created, it will not start running until you call its ________method.
Correct Answer
start( )
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Multiple Answer
Question
Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer
Classes , Subclasses , Packages
Select The Blank
Question
Double data type uses ________ to store a value
Correct Answer
64 bits
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Java Programming - 5
Match The Following
Question
Correct Answer
Constructor
Initialization object
Parameters
Method Generalized
Memory deallocation
Garbage Collection
This
Current Object
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct Answer
Packages
Multiple Choice Single Answer
Question
The argument to which specifies the delayperiod in milliseconds
Correct Answer
sleep( )
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
Match The Following
Question
Correct Answer
Exit any loop
Break
If
Else
Loop
While
Jump
Break, continue, return
True/False
Question
A thread can be preempted by a higher priority thread.
Correct 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;
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct Answer
access class classname implements interface.
Multiple Choice Single Answer
Question
Which statement has a the effect of "jumping out" of the switch statement?
Correct Answer
Break
True/False
Question
There is no Global Variable in Java.
Correct Answer
True
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
True/False
Question
Each class in java can have a finalizer method.
Correct Answer
True
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
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
Select The Blank
Question
Java defines ________ integer type.
Correct Answer
Four
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
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
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct 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]:
True/False
Question
A thread can voluntarily relinquish control.
Correct Answer
False
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
Select The Blank
Question
________ method suspends a thread for some period of time.
Correct Answer
sleep( )
True/False
Question
Running threads can be suspended, which temporarily suspends its activity.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
Select The Blank
Question
Long makes it useful when big ________ numbers are needed.
Correct Answer
Whole
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
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
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
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
Multiple Choice Single Answer
Question
To import a class, what is a syntax used?
Correct Answer
import classname;
Multiple Choice Multiple Answer
Question
Which are the java's control statements?
Correct Answer
For , If , Switch
Select The Blank
Question
________ loop repeats a statement or block while its controlling expressions is true.
Correct 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
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
True/False
Question
Java allows loops to be nested.
Correct Answer
True
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct 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
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
After calling start( ) NewThread, constructor returns to ________.
Correct Answer
main( )
Java Programming - 4
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Multiple Answer
Question
The Bitwise Logical Operators are :-
Correct Answer
^ , ^= , <<
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Select The Blank
Question
Java defines ________ integer type.
Correct Answer
Four
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]:
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct Answer
Packages
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer
Just-In-Time (JIT) compiler.
True/False
Question
Range of char data type in java is 0 to 65,536.
Correct Answer
True
Multiple Choice Single Answer
Question
What is an array?
Correct Answer
It is value collection of same type of data type
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Multiple Choice Multiple Answer
Question
Features of Java applets are :-
Correct Answer
They can be transmitted over internet , Require java enabled web browser
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Multiple Choice Single Answer
Question
Which statement is used inside the switch to terminate a statement sequence?
Correct Answer
Break
Select The Blank
Question
The default ________ of objects protects private and transient data.
Correct Answer
Encoding
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Multiple Choice Single Answer
Question
How multidimensional array is declared?
Correct Answer
int[4] [5];
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Select The Blank
Question
Java defines ________ Primitive type of data.
Correct Answer
Eight
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer
False
Select The Blank
Question
________ variables are declared by use of the Byte Keyword.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
The Stack performs which two function?
Correct Answer
pop( ) , push( )
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following assignments are valid?
Correct Answer
short s = 28; , double d = 2.3; , int I = '1';
Select The Blank
Question
The Process by which one object acquires properties of another object is ________.
Correct Answer
Inheritence
True/False
Question
As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer
True
True/False
Question
Java define eight simple types of data byte, short, int, long, char, float, double, boolean.
Correct Answer
True
Multiple Choice Single Answer
Question
When java program starts up, which thread begins running immediately?
Correct Answer
Main thread
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Multiple Choice Multiple Answer
Question
What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer
Classes , Packages , Subclasses
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , Object
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Select The Blank
Question
A ________ is a subclass of itself.
Correct Answer
Class
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
Select The Blank
Question
The ________ loop is java's most fundamental looping statement.
Correct Answer
While
Select The Blank
Question
________ method suspends a thread for some period of time.
Correct Answer
sleep( )
Multiple Choice Multiple Answer
Question
Modulus operator % can be applied to these data types :-
Correct Answer
floating Point , Integer , Character
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct Answer
If
Select The Blank
Question
The ________ loop repeats a set of statements a certain number of times until a condition is matched.
Correct Answer
For
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
Multiple Choice Single Answer
Question
Which operator is used to create and concatenate string?
Correct Answer
Addition operator(+).
Multiple Choice Single Answer
Question
If omit the package statement, which names are put into defualt pacakge?
Correct Answer
class
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Multiple Choice Multiple Answer
Question
Classes usually consist of two things such as :-
Correct Answer
Instance variable , Methods
True/False
Question
In Interface we need not use the keyword abstract for the methods.
Correct Answer
True
Multiple Choice Multiple Answer
Question
What modifiers may be used with top-level class?
Correct Answer
Public , Abstract , Final
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Single Answer
Question
What is an array?
Correct Answer
It is value collection of same type of data type
True/False
Question
The switch statement does not require a break.
Correct Answer
False
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
Multiple Choice Single Answer
Question
Which class can be extended?
Correct Answer
threadclass
Select The Blank
Question
________ variables are declared by use of the Byte Keyword.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Match The Following
Question
Correct Answer
For statement
Initialization, condition, iteration
Multi way branch statement
Switch statement
To terminate the statement
Break
Iteration statement
Do while
Multiple Choice Single Answer
Question
Which statement checks at the beginning of a loop to see whether the next loop iteration should occur?
Correct Answer
While
Select The Blank
Question
The Process by which one object acquires properties of another object is ________.
Correct Answer
Inheritence
Multiple Choice Single Answer
Question
Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer
Jump
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
True/False
Question
Casting between primitive types allows conversion of one primitive type to another.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
True/False
Question
Variable in an interface are implicitly final and static.
Correct Answer
True
Multiple Choice Multiple Answer
Question
When might your program wish to run the garbage collector?
Correct Answer
When it knows there will be some idle time , Before it enters a compute-intense section of code , Before it enters a memory-intense section of code
Multiple Choice Single Answer
Question
How to change the values of the elements of the array?
Correct Answer
By using array subscript expression
Multiple Choice Single Answer
Question
Which of the following is used to get the value of the instance variables?
Correct Answer
Dot Notation
True/False
Question
Integer can Cast to byte value.
Correct Answer
False
Select The Blank
Question
________ is an instance of the class.
Correct Answer
Object
Match The Following
Question
Correct Answer
Subclass of the Exception
RuntimeException
Access modifier
Public
Variable in inetrface
Static type
Handle exceptions
Throws class
True/False
Question
Casting occurs commonly between numeric types
Correct Answer
True
True/False
Question
If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer
True
Select The Blank
Question
Multiple inheritance in Java can be achieve by ________.
Correct Answer
Interface
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Single Answer
Question
What are members of the threads class?
Correct Answer
Method
Multiple Choice Single Answer
Question
How do you assign values to variables?
Correct Answer
By using the assignment operator =.
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
True/False
Question
As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer
True
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
Select The Blank
Question
After the new thread is created, it will not start running until you call its ________method.
Correct Answer
start( )
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Multiple Answer
Question
Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer
Classes , Subclasses , Packages
Select The Blank
Question
Double data type uses ________ to store a value
Correct Answer
64 bits
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Java Programming - 5
Match The Following
Question
Correct Answer
Constructor
Initialization object
Parameters
Method Generalized
Memory deallocation
Garbage Collection
This
Current Object
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct Answer
Packages
Multiple Choice Single Answer
Question
The argument to which specifies the delayperiod in milliseconds
Correct Answer
sleep( )
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
Match The Following
Question
Correct Answer
Exit any loop
Break
If
Else
Loop
While
Jump
Break, continue, return
True/False
Question
A thread can be preempted by a higher priority thread.
Correct 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;
Multiple Choice Single Answer
Question
How to declare an interface example?
Correct Answer
access class classname implements interface.
Multiple Choice Single Answer
Question
Which statement has a the effect of "jumping out" of the switch statement?
Correct Answer
Break
True/False
Question
There is no Global Variable in Java.
Correct Answer
True
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
True/False
Question
Each class in java can have a finalizer method.
Correct Answer
True
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
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
Select The Blank
Question
Java defines ________ integer type.
Correct Answer
Four
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
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
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct 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]:
True/False
Question
A thread can voluntarily relinquish control.
Correct Answer
False
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
Select The Blank
Question
________ method suspends a thread for some period of time.
Correct Answer
sleep( )
True/False
Question
Running threads can be suspended, which temporarily suspends its activity.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
Select The Blank
Question
Long makes it useful when big ________ numbers are needed.
Correct Answer
Whole
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
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
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
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
Multiple Choice Single Answer
Question
To import a class, what is a syntax used?
Correct Answer
import classname;
Multiple Choice Multiple Answer
Question
Which are the java's control statements?
Correct Answer
For , If , Switch
Select The Blank
Question
________ loop repeats a statement or block while its controlling expressions is true.
Correct 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
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
True/False
Question
Java allows loops to be nested.
Correct Answer
True
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Multiple Choice Single Answer
Question
When you implement an interface method, it must be declared as :-
Correct 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
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Multiple Answer
Question
Which one does not extend java.lang.Number?
Correct Answer
Boolean , Character
Select The Blank
Question
After calling start( ) NewThread, constructor returns to ________.
Correct Answer
main( )
Java Programming - 4
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Multiple Choice Multiple Answer
Question
The Bitwise Logical Operators are :-
Correct Answer
^ , ^= , <<
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Select The Blank
Question
Java defines ________ integer type.
Correct Answer
Four
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]:
Select The Blank
Question
The ________ statement defines a name space in which classes are stored
Correct Answer
Packages
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer
Just-In-Time (JIT) compiler.
True/False
Question
Range of char data type in java is 0 to 65,536.
Correct Answer
True
Multiple Choice Single Answer
Question
What is an array?
Correct Answer
It is value collection of same type of data type
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
True/False
Question
The for statement loop can be infinite.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Multiple Choice Multiple Answer
Question
Features of Java applets are :-
Correct Answer
They can be transmitted over internet , Require java enabled web browser
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Multiple Choice Single Answer
Question
Which statement is used inside the switch to terminate a statement sequence?
Correct Answer
Break
Select The Blank
Question
The default ________ of objects protects private and transient data.
Correct Answer
Encoding
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Multiple Choice Single Answer
Question
How multidimensional array is declared?
Correct Answer
int[4] [5];
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Select The Blank
Question
Java defines ________ Primitive type of data.
Correct Answer
Eight
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer
False
Select The Blank
Question
________ variables are declared by use of the Byte Keyword.
Correct Answer
Byte
Multiple Choice Multiple Answer
Question
The Stack performs which two function?
Correct Answer
pop( ) , push( )
True/False
Question
Float data type is useful when we need fractional values.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following assignments are valid?
Correct Answer
short s = 28; , double d = 2.3; , int I = '1';
Select The Blank
Question
The Process by which one object acquires properties of another object is ________.
Correct Answer
Inheritence
True/False
Question
As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer
True
True/False
Question
Java define eight simple types of data byte, short, int, long, char, float, double, boolean.
Correct Answer
True
Multiple Choice Single Answer
Question
When java program starts up, which thread begins running immediately?
Correct Answer
Main thread
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Multiple Choice Multiple Answer
Question
What are means of encapsulating and containing the name space and scope of variables and methods?
Correct Answer
Classes , Packages , Subclasses
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , Object
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
Which statement is used to explicitly return from a method?
Correct Answer
Return
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Select The Blank
Question
A ________ is a subclass of itself.
Correct Answer
Class
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
Select The Blank
Question
The ________ loop is java's most fundamental looping statement.
Correct Answer
While
Select The Blank
Question
________ method suspends a thread for some period of time.
Correct Answer
sleep( )
Multiple Choice Multiple Answer
Question
Modulus operator % can be applied to these data types :-
Correct Answer
floating Point , Integer , Character
Select The Blank
Question
________ statement in java is conditional branch statement.
Correct Answer
If
Java Programming - 3
Java Programming - 3
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
True/False
Question
Each class in java can have a finalizer method.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Multiple Choice Single Answer
Question
Which operator is used to create and concatenate string?
Correct Answer
Addition operator(+).
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
Multiple Choice Single Answer
Question
Which statement will always execute the body of a loop at least once?
Correct Answer
Do
Select The Blank
Question
Double data type uses ________ to store a value
Correct Answer
64 bits
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
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
Match The Following
Question
Correct Answer
The data, or variable, defined within a class
Instance variable.
General form of Cast
(target--type)value
Determine the relationship that one operand has to the other
Relational Operator
The secondary versions of the Boolean AND and OR operators
Short-Circuit Logical Operators
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;
Select The Blank
Question
Threads define several ________.
Correct Answer
constructors
True/False
Question
A thread can be blocked when waiting for a resource.
Correct Answer
True
Multiple Choice Single Answer
Question
Which cast must be used to convert a larger value into a smaller one?
Correct Answer
Explicit cast.
Select The Blank
Question
________ is the logical construct upon which the entire java language is built.
Correct Answer
Class
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
True/False
Question
Short data type range is -30,376 to 32768.
Correct Answer
False
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
For , While , Do-while
Match The Following
Question
Correct Answer
Exit any loop
Break
If
Else
Loop
While
Jump
Break, continue, return
Select The Blank
Question
A ________can implement more than one interface.
Correct Answer
Class
Select The Blank
Question
The most commonly used ________eger type is int.
Correct Answer
int
Select The Blank
Question
In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer
Switch
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
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
True/False
Question
There is no Global Variable in Java.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
Multiple Choice Single Answer
Question
How to change the values of the elements of the array?
Correct Answer
By using array subscript expression
Multiple Choice Multiple Answer
Question
Which loops can be nested in java?
Correct Answer
While , Do-while , For
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
True/False
Question
All the methods declared inside an Interface are abstract.
Correct Answer
True
Multiple Choice Single Answer
Question
Which Control Statements allow the program to choose different paths of execution?
Correct Answer
Selection
Multiple Choice Single Answer
Question
What are primitive data types?
Correct Answer
byte, short, int, long
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
True/False
Question
A suspended thread can then be resumed allowing it to pick up where it left off.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
Multiple Choice Single Answer
Question
How array is defined?
Correct Answer
int arr[];
Multiple Choice Single Answer
Question
How do you assign values to variables?
Correct Answer
By using the assignment operator =.
True/False
Question
Byte can be Cast to Double Value.
Correct Answer
True
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
Is it necessary to implement all the methods of an interface while implementing the interface
Correct Answer
False
Java Programming - 2
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Multiple Choice Single Answer
Question
How can class be imported from a package to a program?
Correct Answer
import java.packagename.classname
Multiple Choice Single Answer
Question
Which keyword is used to create an instance of a class?
Correct Answer
new
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Multiple Choice Single Answer
Question
How multidimensional array is declared?
Correct Answer
int[4] [5];
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , Object
True/False
Question
Casting occurs commonly between numeric types
Correct Answer
True
Select The Blank
Question
Start( )executes a call to ________.
Correct Answer
run( )
True/False
Question
Running threads can be suspended, which temporarily suspends its activity.
Correct Answer
True
Select The Blank
Question
A ________ is a subclass of itself.
Correct Answer
Class
Multiple Choice Single Answer
Question
How many concrete classes can you have inside an interface?
Correct Answer
none
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Multiple Choice Single Answer
Question
Which of the following can be referenced by 'this' variable?
Correct Answer
The instance variables and methods of a class
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
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer
False
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;
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer
Just-In-Time (JIT) compiler.
Match The Following
Question
Correct Answer
The data, or variable, defined within a class
Instance variable.
General form of Cast
(target--type)value
Determine the relationship that one operand has to the other
Relational Operator
The secondary versions of the Boolean AND and OR operators
Short-Circuit Logical Operators
Multiple Choice Multiple Answer
Question
Modulus operator % can be applied to these data types :-
Correct Answer
floating Point , Integer , Character
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Select The Blank
Question
For externalizable objects the ________ is solely responsible for the external format of its contents.
Correct Answer
Class
Multiple Choice Single Answer
Question
Using which keyword we can fully abstract a class?
Correct Answer
interface
Select The Blank
Question
The ________ repeat a set of code while the condition is false.
Correct Answer
While loop
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer
True
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
Multiple Choice Multiple Answer
Question
The source for the frist package defines three classes
Correct Answer
Protection , Derived , SamePackage
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct Answer
public
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
True/False
Question
A thread can be blocked when waiting for a resource.
Correct Answer
True
Select The Blank
Question
A ________can implement more than one interface.
Correct Answer
Class
True/False
Question
Boolean values can be cast into any other primitive type.
Correct Answer
False
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Select The Blank
Question
The name of the new thread is specified by ________.
Correct Answer
threadName
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
Java Programming - 1
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Multiple Choice Single Answer
Question
How can class be imported from a package to a program?
Correct Answer
import java.packagename.classname
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
Multiple Choice Single Answer
Question
Which Control Statements enable program execution to repeat one or more statements?
Correct Answer
Iteration
Select The Blank
Question
The ________ loop is java's most fundamental looping statement.
Correct Answer
While
Select The Blank
Question
Java defines ________ Primitive type of data.
Correct Answer
Eight 8 simple types of data: byte, short, int, long (INTEGERS), float, double(FLOATING TYPE), char, and Boolean
True/False
Question
Boolean data types have only Yes or No value.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer
Classes , Subclasses , Packages
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution: -
Correct Answer
Just-In-Time (JIT) compiler.
True/False
Question
If the break statement is omitted in switch statement, then execution will continue on into the next case.
Correct Answer
True
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
Multiple Choice Single Answer
Question
Which statement will always execute the body of a loop at least once?
Correct Answer
Do
True/False
Question
A suspended thread can then be resumed allowing it to pick up where it left off.
Correct Answer
True
True/False
Question
The Switch statement can have multiple cases without a break statements between them.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
True/False
Question
In Interface we need not use the keyword abstract for the methods.
Correct Answer
True
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct Answer
type identifier [=value][,identifier[=value]…]
Select The Blank
Question
The range of Byte is ________
Correct Answer
(-128 to 127)
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Select The Blank
Question
________ is the logical construct upon which the entire java language is built.
Correct Answer
Class
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Match The Following
Question
Correct Answer
For statement
Initialization, condition, iteration
Multi way branch statement
Switch statement
To terminate the statement
Break
Iteration statement
Do while
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Select The Blank
Question
________ is referred by a variable candidate for garbage collection when the variable goes out of scope.
Correct Answer
Objects
Multiple Choice Multiple Answer
Question
Features of Java applets are :-
Correct Answer
They can be transmitted over internet , Require java enabled web browser
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
True/False
Question
Range of char data type in java is 0 to 65,536.
Correct Answer
True
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
True/False
Question
Casting between primitive types allows conversion of one primitive type to another.
Correct 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;
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
True/False
Question
When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer
True
Match The Following
Question
Correct Answer
Class
New data type
Passing by value
Methods - pass by value
Passing by reference
Objects – pass by reference
Methods and variable
Members of class
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
Select The Blank
Question
________can be extended.
Correct Answer
Interface
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Multiple Choice Single Answer
Question
Which of the following is used to get the value of the instance variables?
Correct Answer
Dot Notation
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Multiple Choice Multiple Answer
Question
What all the run( ) method can do?
Correct Answer
Can call other method , Declare variable
True/False
Question
Each class in java can have a finalizer method.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Multiple Choice Single Answer
Question
Which operator is used to create and concatenate string?
Correct Answer
Addition operator(+).
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
Multiple Choice Single Answer
Question
Which statement will always execute the body of a loop at least once?
Correct Answer
Do
Select The Blank
Question
Double data type uses ________ to store a value
Correct Answer
64 bits
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
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
Match The Following
Question
Correct Answer
The data, or variable, defined within a class
Instance variable.
General form of Cast
(target--type)value
Determine the relationship that one operand has to the other
Relational Operator
The secondary versions of the Boolean AND and OR operators
Short-Circuit Logical Operators
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;
Select The Blank
Question
Threads define several ________.
Correct Answer
constructors
True/False
Question
A thread can be blocked when waiting for a resource.
Correct Answer
True
Multiple Choice Single Answer
Question
Which cast must be used to convert a larger value into a smaller one?
Correct Answer
Explicit cast.
Select The Blank
Question
________ is the logical construct upon which the entire java language is built.
Correct Answer
Class
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
True/False
Question
Short data type range is -30,376 to 32768.
Correct Answer
False
Select The Blank
Question
________method starts a threrad by calling its run method.
Correct Answer
start( )
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
For , While , Do-while
Match The Following
Question
Correct Answer
Exit any loop
Break
If
Else
Loop
While
Jump
Break, continue, return
Select The Blank
Question
A ________can implement more than one interface.
Correct Answer
Class
Select The Blank
Question
The most commonly used ________eger type is int.
Correct Answer
int
Select The Blank
Question
In ________ statement the value of the expression is compared with each of the literal values in case statements.
Correct Answer
Switch
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
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
True/False
Question
There is no Global Variable in Java.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which are keywords in Java?
Correct Answer
Extends , Synchronized , Sizeof
Select The Blank
Question
There are ________ kinds of Floating point type
Correct Answer
Two
Multiple Choice Single Answer
Question
How to change the values of the elements of the array?
Correct Answer
By using array subscript expression
Multiple Choice Multiple Answer
Question
Which loops can be nested in java?
Correct Answer
While , Do-while , For
Multiple Choice Multiple Answer
Question
Which are the keywords use in switch statement?
Correct Answer
Case , Default
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
True/False
Question
All the methods declared inside an Interface are abstract.
Correct Answer
True
Multiple Choice Single Answer
Question
Which Control Statements allow the program to choose different paths of execution?
Correct Answer
Selection
Multiple Choice Single Answer
Question
What are primitive data types?
Correct Answer
byte, short, int, long
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
True/False
Question
A suspended thread can then be resumed allowing it to pick up where it left off.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Java's multithreading system is built upon :-
Correct Answer
Thread class , Its methods , Companion interface
Multiple Choice Single Answer
Question
How array is defined?
Correct Answer
int arr[];
Multiple Choice Single Answer
Question
How do you assign values to variables?
Correct Answer
By using the assignment operator =.
True/False
Question
Byte can be Cast to Double Value.
Correct Answer
True
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
Is it necessary to implement all the methods of an interface while implementing the interface
Correct Answer
False
Java Programming - 2
Multiple Choice Multiple Answer
Question
Which are the two threads of java?
Correct Answer
mainthread( ) , childthread( )
Multiple Choice Single Answer
Question
How can class be imported from a package to a program?
Correct Answer
import java.packagename.classname
Multiple Choice Single Answer
Question
Which keyword is used to create an instance of a class?
Correct Answer
new
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Multiple Choice Single Answer
Question
How multidimensional array is declared?
Correct Answer
int[4] [5];
Multiple Choice Multiple Answer
Question
What returns a reference to the thread in which it is called?
Correct Answer
Method , Class , Object
True/False
Question
Casting occurs commonly between numeric types
Correct Answer
True
Select The Blank
Question
Start( )executes a call to ________.
Correct Answer
run( )
True/False
Question
Running threads can be suspended, which temporarily suspends its activity.
Correct Answer
True
Select The Blank
Question
A ________ is a subclass of itself.
Correct Answer
Class
Multiple Choice Single Answer
Question
How many concrete classes can you have inside an interface?
Correct Answer
none
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Multiple Choice Single Answer
Question
Which of the following can be referenced by 'this' variable?
Correct Answer
The instance variables and methods of a class
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
True/False
Question
Object oriented programming organizes a program around processes acting on data.
Correct Answer
False
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;
Select The Blank
Question
________ are stored in hierarchical manner.
Correct Answer
Packages
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution :-
Correct Answer
Just-In-Time (JIT) compiler.
Match The Following
Question
Correct Answer
The data, or variable, defined within a class
Instance variable.
General form of Cast
(target--type)value
Determine the relationship that one operand has to the other
Relational Operator
The secondary versions of the Boolean AND and OR operators
Short-Circuit Logical Operators
Multiple Choice Multiple Answer
Question
Modulus operator % can be applied to these data types :-
Correct Answer
floating Point , Integer , Character
Multiple Choice Multiple Answer
Question
Expression must be of the data types :-
Correct Answer
Byte , Short , Int
Select The Blank
Question
For externalizable objects the ________ is solely responsible for the external format of its contents.
Correct Answer
Class
Multiple Choice Single Answer
Question
Using which keyword we can fully abstract a class?
Correct Answer
interface
Select The Blank
Question
The ________ repeat a set of code while the condition is false.
Correct Answer
While loop
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
Multiple Choice Single Answer
Question
Which method is used to determine the class of an object?
Correct Answer
getClass( ) method
Select The Blank
Question
The mechanism which binds together the code and data and keeps both safe is ________.
Correct Answer
Encapsulation
True/False
Question
Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
Correct Answer
False
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
What are the kinds of variables in Java?
Correct Answer
Instance, local, class variables
True/False
Question
If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer
True
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
Multiple Choice Multiple Answer
Question
The source for the frist package defines three classes
Correct Answer
Protection , Derived , SamePackage
Multiple Choice Multiple Answer
Question
Exit statement is optional in which loops in java?
Correct Answer
While , Do-while , For
Select The Blank
Question
In ________ statement condition is true, then statement 1 is executed.
Correct Answer
If
Multiple Choice Single Answer
Question
What are the possible access modifiers while implementing interface methods?
Correct Answer
public
Multiple Choice Multiple Answer
Question
Which is a public static member of thread?
Correct Answer
currenthread( ) , mainthread( )
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
True/False
Question
A thread can be blocked when waiting for a resource.
Correct Answer
True
Select The Blank
Question
A ________can implement more than one interface.
Correct Answer
Class
True/False
Question
Boolean values can be cast into any other primitive type.
Correct Answer
False
True/False
Question
Constructors can be overloaded like regular methods.
Correct Answer
True
Select The Blank
Question
The name of the new thread is specified by ________.
Correct Answer
threadName
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Match The Following
Question
Correct Answer
It can have only one of two possible values
Boolean type
Float hightemp, lowtemp
Float variable declarations
Smallest int type
Byte
Floating point numbers are also known as
Real Numbers
Java Programming - 1
Multiple Choice Single Answer
Question
What is meant by garbage collection?
Correct Answer
Object is no longer referred to by any variable
Multiple Choice Single Answer
Question
How can class be imported from a package to a program?
Correct Answer
import java.packagename.classname
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
Multiple Choice Single Answer
Question
Which Control Statements enable program execution to repeat one or more statements?
Correct Answer
Iteration
Select The Blank
Question
The ________ loop is java's most fundamental looping statement.
Correct Answer
While
Select The Blank
Question
Java defines ________ Primitive type of data.
Correct Answer
Eight 8 simple types of data: byte, short, int, long (INTEGERS), float, double(FLOATING TYPE), char, and Boolean
True/False
Question
Boolean data types have only Yes or No value.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Within what Java provides many levels of protection to allow control over the visiblity of variables and methods?
Correct Answer
Classes , Subclasses , Packages
Multiple Choice Single Answer
Question
Java was developed at :-
Correct Answer
Sun Microsystems
Multiple Choice Single Answer
Question
Select the facility provided along with JVM which enhances speed of execution: -
Correct Answer
Just-In-Time (JIT) compiler.
True/False
Question
If the break statement is omitted in switch statement, then execution will continue on into the next case.
Correct Answer
True
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
Multiple Choice Single Answer
Question
Which statement will always execute the body of a loop at least once?
Correct Answer
Do
True/False
Question
A suspended thread can then be resumed allowing it to pick up where it left off.
Correct Answer
True
True/False
Question
The Switch statement can have multiple cases without a break statements between them.
Correct Answer
True
Multiple Choice Multiple Answer
Question
Which of the following are mathematical Expressions?
Correct Answer
(+ +) , (+ =) , (- =)
True/False
Question
In Interface we need not use the keyword abstract for the methods.
Correct Answer
True
Multiple Choice Single Answer
Question
Syntax to declare a variable in java is :-
Correct Answer
type identifier [=value][,identifier[=value]…]
Select The Blank
Question
The range of Byte is ________
Correct Answer
(-128 to 127)
Select The Blank
Question
The mechanism by which java frees the memory occupied by unused objects is ________.
Correct Answer
Garbage Collection
Multiple Choice Multiple Answer
Question
What are different data types in java?
Correct Answer
char , double , byte
Select The Blank
Question
________ is the logical construct upon which the entire java language is built.
Correct Answer
Class
Multiple Choice Multiple Answer
Question
Method definition has four parts, they are :-
Correct Answer
Name of the method , Type of object , List of parameters
Match The Following
Question
Correct Answer
For statement
Initialization, condition, iteration
Multi way branch statement
Switch statement
To terminate the statement
Break
Iteration statement
Do while
Multiple Choice Single Answer
Question
A Java application can execute anywhere on the network, this implements that Java is :-
Correct Answer
Architecture neutral
Select The Blank
Question
________ is referred by a variable candidate for garbage collection when the variable goes out of scope.
Correct Answer
Objects
Multiple Choice Multiple Answer
Question
Features of Java applets are :-
Correct Answer
They can be transmitted over internet , Require java enabled web browser
Multiple Choice Multiple Answer
Question
Packages act as containers for :-
Correct Answer
Classes , Subordinate packages
Multiple Choice Single Answer
Question
What is a string?
Correct Answer
A combination of characters called as string
Multiple Choice Single Answer
Question
Multiple Choice Single Response
Correct Answer
Object oriented programming.
Select The Blank
Question
The ________ repeats a set of code at least once before the condition is tested.
Correct Answer
Do-while loop
True/False
Question
Range of char data type in java is 0 to 65,536.
Correct Answer
True
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
True/False
Question
Casting between primitive types allows conversion of one primitive type to another.
Correct 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;
Multiple Choice Multiple Answer
Question
What are the Logical operators?
Correct Answer
OR() , AND(&) , XOR(^)
True/False
Question
When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer
True
Match The Following
Question
Correct Answer
Class
New data type
Passing by value
Methods - pass by value
Passing by reference
Objects – pass by reference
Methods and variable
Members of class
Multiple Choice Single Answer
Question
Which statement defines a name space in which classes are stored?
Correct Answer
package
Select The Blank
Question
________can be extended.
Correct Answer
Interface
Multiple Choice Single Answer
Question
Java Applets are intelligent programs means :-
Correct Answer
They can react to user input and dynamically change.
Multiple Choice Single Answer
Question
Which of the following is used to get the value of the instance variables?
Correct Answer
Dot Notation
Multiple Choice Multiple Answer
Question
Which statements can be used with the java's loop?
Correct Answer
Jump , Continue , Break
Multiple Choice Multiple Answer
Question
Java Operators can be divided into these groups :-
Correct Answer
Arithmetic , Bitwise , Relational
Multiple Choice Single Answer
Question
Which is the default access modifier for an interface method?
Correct Answer
public
Select The Blank
Question
Anything declared ________ can be accessed from anywhere within program.
Correct Answer
Public
Select The Blank
Question
Java virtual machine works as ________ for the the bytecode.
Correct Answer
Interpreter
Subscribe to:
Posts (Atom)