Showing posts with label Java Programming (Set VI). Show all posts
Showing posts with label Java Programming (Set VI). Show all posts

Wednesday, August 6, 2008

Java Programming - 18

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

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

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

Multiple Choice Single Answer
Question: What are members of the threads class?
Correct Answer: Method
Your Answer: Method

True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Your Answer: False

Select The Blank
Question: The ________ loop is java's most fundamental looping statement.
Correct Answer: While
Your Answer: While

Multiple Choice Single Answer
Question: In multithreaded program each part of such program is called :-
Correct Answer: Thread
Your Answer: Thread

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

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

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

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

True/False
Question: As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer: True
Your Answer: True

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

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

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
Your Answer: The value assigned is 20

True/False
Question: When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer: True
Your Answer: True

Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Your Answer: Byte

Multiple Choice Single Answer
Question: Which cast must be used to cast an object to another class?
Correct Answer: Specific cast.
Your Answer: Explicit cast.

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

Multiple Choice Multiple Answer
Question: What are different data types in java?
Correct Answer: char , double , byte
Your Answer: char , double , byte

Match The Following
Question Correct Answer Your Answer
The Operators used in mathematical Arithmetic Operator (= operator;)
expressions
Order in which operators are Order of precedence Order of precedence
evaluated in expressions.
Whether an expression is evaluated Associativity Associativity
left-to-right or right-to-left
Java operator syntax for right (= operator;) Comparison Operator
associativity

Multiple Choice Single Answer
Question: Java uses which system to store packages?
Correct Answer: File system directories
Your Answer: File system directories

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

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

Select The Blank
Question: After the new thread is created, it will not start running until you call its ________method.
Correct Answer: start( )
Your Answer: start( )

Select The Blank
Question: The ________ repeats a set of code at least once before the condition is tested.
Correct Answer: Do-while loop
Your Answer: Do-while loop

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

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

Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
Your Answer: ^ , <<

Select The Blank
Question: The name of the new thread is specified by ________.
Correct Answer: threadName
Your Answer: Currentthread

Select The Blank
Question: ________ is probably the least used java data type
Correct Answer: short
Your Answer: short

Multiple Choice Single Answer
Question: How to change the values of the elements of the array?
Correct Answer: By using array subscript expression
Your Answer: By specifying index number

Multiple Choice Single Answer
Question: What is declared within the file that will belong to the specified pacakage?
Correct Answer: classes
Your Answer: classes

Multiple Choice Single Answer
Question: How many concrete classes can you have inside an interface?
Correct Answer: none
Your Answer: none

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

Select The Blank
Question: A class is ________ for an objects in java.
Correct Answer: Template
Your Answer: Template

Select The Blank
Question: Anonymous classes be implemented in an ________.
Correct Answer: Interface
Your Answer: Method

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
Your Answer: False

Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
Your Answer: They can be transmitted over internet , Require java enabled web browser , They are intelligent programs.

Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Your Answer: Instance variable , Methods

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

True/False
Question: If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer: True
Your Answer: True

Multiple Choice Multiple Answer
Question: Which are the two threads of java?
Correct Answer: mainthread( ) , childthread( )
Your Answer: mainthread( ) , current

Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
Your Answer: For

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

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
Your Answer: Packages , Subclasses

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

Multiple Choice Single Answer
Question: Which statement will always execute the body of a loop at least once?
Correct Answer: Do
Your Answer: Do

Java Programming - 19

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

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

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

Multiple Choice Single Answer
Question: What are members of the threads class?
Correct Answer: Method
Your Answer: Method

True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Your Answer: False

Select The Blank
Question: The ________ loop is java's most fundamental looping statement.
Correct Answer: While
Your Answer: While

Multiple Choice Single Answer
Question: In multithreaded program each part of such program is called :-
Correct Answer: Thread
Your Answer: Thread

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

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

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

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

True/False
Question: As abstract class must have at least one abstract method and others may be concrete or abstract.
Correct Answer: True
Your Answer: True

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

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

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
Your Answer: The value assigned is 20

True/False
Question: When for loop start the execution, the initialization portion of the loop is executed.
Correct Answer: True
Your Answer: True

Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Your Answer: Byte

Multiple Choice Single Answer
Question: Which cast must be used to cast an object to another class?
Correct Answer: Specific cast.
Your Answer: Explicit cast.

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

Multiple Choice Multiple Answer
Question: What are different data types in java?
Correct Answer: char , double , byte
Your Answer: char , double , byte

Match The Following
Question Correct Answer Your Answer
The Operators used in mathematical Arithmetic Operator (= operator;)
expressions
Order in which operators are evaluated in Order of precedence Order of precedence
expressions.
Whether an expression is evaluated Associativity Associativity
left-to-right or right-to-left.
Java operator syntax for right associativity (= operator;) Comparison Operator

Multiple Choice Single Answer
Question: Java uses which system to store packages?
Correct Answer: File system directories
Your Answer: File system directories

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

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

Select The Blank
Question: After the new thread is created, it will not start running until you call its ________method.
Correct Answer: start( )
Your Answer: start( )

Select The Blank
Question: The ________ repeats a set of code at least once before the condition is tested.
Correct Answer: Do-while loop
Your Answer: Do-while loop

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

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

Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
Your Answer: ^ , <<

Select The Blank
Question: The name of the new thread is specified by ________.
Correct Answer: threadName
Your Answer: Currentthread

Select The Blank
Question: ________ is probably the least used java data type
Correct Answer: short
Your Answer: short

Multiple Choice Single Answer
Question: How to change the values of the elements of the array?
Correct Answer: By using array subscript expression
Your Answer: By specifying index number

Multiple Choice Single Answer
Question: What is declared within the file that will belong to the specified pacakage?
Correct Answer: classes
Your Answer: classes

Multiple Choice Single Answer
Question: How many concrete classes can you have inside an interface?
Correct Answer: none
Your Answer: none

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

Select The Blank
Question: A class is ________ for an objects in java.
Correct Answer: Template
Your Answer: Template

Select The Blank
Question: Anonymous classes be implemented in an ________.
Correct Answer: Interface
Your Answer: Method

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
Your Answer: False

Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
Your Answer: They can be transmitted over internet , Require java enabled web browser , They are intelligent programs.

Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Your Answer: Instance variable , Methods

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

True/False
Question: If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer: True
Your Answer: True

Multiple Choice Multiple Answer
Question: Which are the two threads of java?
Correct Answer: mainthread( ) , childthread( )
Your Answer: mainthread( ) , current

Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
Your Answer: For

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

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
Your Answer: Packages , Subclasses

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

Multiple Choice Single Answer
Question: Which statement will always execute the body of a loop at least once?
Correct Answer: Do
Your Answer: Do

Java Programming - 16

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

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

True/False
Question: Casting does not affect the original object or value.
Correct Answer: True
Your Answer: True

Multiple Choice Single Answer
Question: In multithreaded program each part of such program is called :-
Correct Answer: Thread
Your Answer: Thread

Multiple Choice Multiple Answer
Question: The Stack performs which two function?
Correct Answer: pop( ) , push( )
Your Answer: pop( ) , push( )

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

Multiple Choice Multiple Answer
Question: The Bitwise Logical Operators are :-
Correct Answer: ^ , ^= , <<
Your Answer: & , ^

Match The Following
Question Correct Answer Your Answer
Interface Abtract method Abtract method
Pacakge declaration Package pkg Package pkg
Java.applet. AppletClass AppletClass
AppletJava.applet Java.applet package Java.applet package

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

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

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
Your Answer: While

Multiple Choice Multiple Answer
Question: Modulus operator % can be applied to these data types :-
Correct Answer: floating Point , Integer , Character
Your Answer: floating Point , Integer

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

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

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

Select The Blank
Question: Anything declared ________ can be accessed from anywhere within program.
Correct Answer: Public
Your Answer: Public

True/False
Question: Java define eight simple types of data byte, short, int, long, char, float, double, boolean.
Correct Answer: True
Your Answer: True

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

Multiple Choice Single Answer
Question: Which of the following is used to get the value of the instance variables?
Correct Answer: Dot Notation
Your Answer: Dot Notation

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

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

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

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

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

Multiple Choice Single Answer
Question: Java uses which system to store packages?
Correct Answer: File system directories
Your Answer: File system directories

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

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

True/False
Question: When you write finalize() method for your class, you are overriding a finalizer inherited from a super class.
Correct Answer: True
Your Answer: True

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

Select The Blank
Question: The default encoding of objects supports the ________ of the classes.
Correct Answer: Evolution
Your Answer: Encoding

True/False
Question: The Switch statement can have multiple cases without a break statements between them.
Correct Answer: True
Your Answer: True

Multiple Choice Single Answer
Question: What is a data structure that controls the state of a collection of threads as a whole?
Correct Answer: Thread group
Your Answer: Exceptions

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

Select The Blank
Question: A ________ is declared by use of the class keyword.
Correct Answer: class
Your Answer: class

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

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

Multiple Choice Multiple Answer
Question: Which thread is created automatically when the program is started?
Correct Answer: Main thread
Your Answer: Main thread

Multiple Choice Multiple Answer
Question: What are the Logical operators?
Correct Answer: OR() , AND(&) , XOR(^)
Your Answer: OR() , AND(&) , XOR(^)

True/False
Question: If the break statement is omited in switch statement, then execution will continue on into the next case.
Correct Answer: True
Your Answer: True

Multiple Choice Single Answer
Question: What can be created by instantiating an object type thread?
Correct Answer: Thread
Your Answer: Method

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

Select The Blank
Question: ________ variables are declared by use of the Byte Keyword.
Correct Answer: Byte
Your Answer: Byte

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

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

Multiple Choice Multiple Answer
Question: Which are the two threads of java?
Correct Answer: mainthread( ) , childthread( )
Your Answer: mainthread( ) , childthread( )

Multiple Choice Multiple Answer
Question: Method definition has four parts, they are :-
Correct Answer: Name of the method , Type of object , List of parameters
Your Answer: Name of the method , Type of object , List of parameters

Select The Blank
Question: The smallest integer type is ________.
Correct Answer: Byte
Your Answer: Byte

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

Java Programming - 17

LIST OF ATTEMPTED QUESTIONS AND ANSWERS

True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Your Answer: True

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

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

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

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

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

Multiple Choice Multiple Answer
Question: What are different data types in java?
Correct Answer: char , double , byte
Your Answer: char , double , byte

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

Match The Following
Question Correct Answer Your Answer
Object Instance of Class Member of Class
Methods Member of Class Instance of Class
Stack First In, Last Out First In, Last Out
Class Object Oriented Programming Object Oriented Programming

True/False
Question: Boolean values can be cast into any other primitive type.
Correct Answer: False
Your Answer: False

True/False
Question: Short data type range is -30,376 to 32768.
Correct Answer: False
Your Answer: True

Multiple Choice Single Answer
Question: How array is defined?
Correct Answer: int arr[];
Your Answer: int arr[];

Select The Blank
Question: In ________ statement condition is true, then statement 1 is executed.
Correct Answer: If
Your Answer: If

Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
Your Answer: They can be transmitted over internet , They require web server for their operation , Require java enabled web browser

True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Your Answer: True

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
Your Answer: The value assigned is 20

Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Your Answer: Objects , Methods

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

Select The Blank
Question: The range of Byte is ________
Correct Answer: (-128 to 127)
Your Answer: (-128 to 127)

True/False
Question: User-defined package can also be imported just like the standard packages.
Correct Answer: True
Your 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
Your Answer: Can extend the thread class , Class object

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

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

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

Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
Your Answer: While loop

Select The Blank
Question: A class can only inherit a single ________.
Correct Answer: Superclass
Your Answer: Superclass

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

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

Multiple Choice Single Answer
Question: Syntax to declare a variable in java is :-
Correct Answer: type identifier [=value][,identifier[=value]…]
Your Answer: type identifier [=value][,identifier[=value]…]

Multiple Choice Single Answer
Question: How can class be imported from a package to a program?
Correct Answer: import java.packagename.classname
Your Answer: import java.packagename.classname

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

Select The Blank
Question: The ________ is similar to break, except that instead of halting the execution of the loop, it starts the next iteration.
Correct Answer: Continue
Your Answer: Loop

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
Your Answer: Classes , Subclasses , Packages

Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
Your Answer: Continue , Break

Multiple Choice Single Answer
Question: Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer: Jump
Your Answer: Jump

True/False
Question: In While loop condition can be any Boolean _expression
Correct Answer: True
Your Answer: True

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

True/False
Question: Object oriented programming organizes a program around processes acting on data.
Correct Answer: False
Your Answer: True

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

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

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

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

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

Multiple Choice Multiple Answer
Question: What are different data types in java?
Correct Answer: char , double , byte
Your Answer: char , double , byte

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

Match The Following
Question Correct Answer Your Answer
Object Instance of Class Member of Class
Methods Member of Class Instance of Class
Stack First In, Last Out First In, Last Out
Class Object Oriented Programming Object Oriented Programming

True/False
Question: Boolean values can be cast into any other primitive type.
Correct Answer: False
Your Answer: False

True/False
Question: Short data type range is -30,376 to 32768.
Correct Answer: False
Your Answer: True

Multiple Choice Single Answer
Question: How array is defined?
Correct Answer: int arr[];
Your Answer: int arr[];

Select The Blank
Question: In ________ statement condition is true, then statement 1 is executed.
Correct Answer: If
Your Answer: If

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

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

Multiple Choice Single Answer
Question: What is an array?
Correct Answer: It is value collection of same type of data type
Your Answer: It is value collection of same type of data type

Multiple Choice Single Answer
Question: Which Control Statements allow the program to choose different paths of execution?
Correct Answer: Selection
Your Answer: Selection

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

Select The Blank
Question: The Process by which one object acquires properties of another object is ________.
Correct Answer: Inheritence
Your Answer: Inheritence

True/False
Question: Threads of equal priority must voluntarily yield control to their peers.
Correct Answer: True
Your Answer: True

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

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

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

Multiple Choice Multiple Answer
Question: Features of Java applets are :-
Correct Answer: They can be transmitted over internet , Require java enabled web browser
Your Answer: They can be transmitted over internet , They require web server for their operation , Require java enabled web browser

True/False
Question: Boolean data type have only Yes or No value.
Correct Answer: True
Your Answer: True

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
Your Answer: The value assigned is 20

Multiple Choice Multiple Answer
Question: Classes usually consist of two things such as :-
Correct Answer: Instance variable , Methods
Your Answer: Methods , Objects

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

Select The Blank
Question: The range of Byte is ________
Correct Answer: (-128 to 127)
Your Answer: (-128 to 127)

True/False
Question: User-defined package can also be imported just like the standard packages.
Correct Answer: True
Your 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
Your Answer: Can extend the thread class , Class object

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

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

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

Select The Blank
Question: The ________ repeat a set of code while the condition is false.
Correct Answer: While loop
Your Answer: While loop

Select The Blank
Question: A class can only inherit a single ________.
Correct Answer: Superclass
Your Answer: Superclass

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

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

Multiple Choice Single Answer
Question: Syntax to declare a variable in java is :-
Correct Answer: type identifier [=value][,identifier[=value]…]
Your Answer: type identifier [=value][,identifier[=value]…]

Multiple Choice Single Answer
Question: How can class be imported from a package to a program?
Correct Answer: import java.packagename.classname
Your Answer: import java.packagename.classname

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

Select The Blank
Question: The ________ is similar to break, except that instead of halting the execution of the loop, it starts the next iteration.
Correct Answer: Continue
Your Answer: Loop

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
Your Answer: Classes , Subclasses , Packages

Multiple Choice Multiple Answer
Question: Which statements can be used with the java's loop?
Correct Answer: Jump , Continue , Break
Your Answer: Continue , Break

Multiple Choice Single Answer
Question: Which Control Statement allow the program to execute in a non-linear fashion?
Correct Answer: Jump
Your Answer: Jump

True/False
Question: In While loop condition can be any Boolean _expression
Correct Answer: True
Your Answer: True

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