Related Questions
What is the correct answer?
4
It is an error to catch the same type of exception in two different catch blocks associated with a particular try block.
What is the correct answer?
4
What does the following line of code do?
TextField text=new TextField(10);
A. Creates text object that can hold 10 rows of text.
B. Creates text object that can hold 10 columns of text.
C. Creates the object text and initializes it with the value 10.
What is the correct answer?
4
In evaluating a logical expression of type 'Boolean expression 1&& Boolean expression 2', both the Boolean expressions are not always evaluated.
What is the correct answer?
4
What is wrong in the following class definitions?
abstract class print {
abstract show();
}
class Display extends print {
}
B. Wrong Method show() should have a return type
C. Wrong Methods show() is not implemented in Display
D. Wrong Display does not contain any members.
What is the correct answer?
4
Consider the following class definitions:
class maths {
student student1;
}
class student {
String name;
}
This code represents:
A. an 'is a' relationship
B. a 'has a' relationship
What is the correct answer?
4
Consider the following statements:
int x = 10, y = 15;
x = ((x < y) ? (y + x) : (y - x);
What will be the value of x after executing these statements?
D. Error can't be executed.
What is the correct answer?
4
Which of the following statements are true?
A. An abstract class may not have any final methods?
B. A final class may not have any abstracts methods.
C. Transient variables must be static.
What is the correct answer?
4
Consider the following code snippet:
try
{
int x=0; int y=50/x;
System.out.println("Division by zero");
}
catch(ArithmeticException e)
{
System.out.println("catch block");
}
What will be the output?
D. Division by zero catch block
What is the correct answer?
4
Two methods cannot have the same name in Java.
What is the correct answer?
4
In a single Servlet class we can use____________
A. doGet(...) method only
B. doPost(...) method only
C. doGet(...) method and doPost(...) method both at a time.
What is the correct answer?
4
Which of the following classes are available in the java.lang package?
What is the correct answer?
4
Every call to wait has a corresponding call to notify that will eventually end the wafting.
What is the correct answer?
4
The methods wait() and noify() are defined in
What is the correct answer?
4
Servlet can have ___________
A. get method and post method
B. get method or post method
What is the correct answer?
4
When X is a positive number the operations x>> 2 and x>>>2 both produce the same result.
What is the correct answer?
4
We would like to make a member of a class visible in all subclasses regardless of what package they are in. Which one of the following keywords would achieve this?
What is the correct answer?
4
Frames and applets cannot be used together in the same program.
What is the correct answer?
4
Which of the following methods belong to the String class?
What is the correct answer?
4
One the features of is that an array can store many different types of values.
What is the correct answer?
4
An individual array element that is passed to a method and modified in that method will contain the modified value when the called method completes execution.
What is the correct answer?
4
Java is fully object oriented programme.
What is the correct answer?
4
Any method in a supper class can be over ridden in its subclass.
What is the correct answer?
4
Which of the following will produce a value of 10 if x = 9.7?
What is the correct answer?
4
A thread can make second thread ineligible for execution by calling the suspend (-) method on second thread.
What is the correct answer?
4
When present, package must be the first no comment statement in the file.
What is the correct answer?
4
forName() is a static factory method
What is the correct answer?
4
In the code below, what data types the variable x can have?
What is the correct answer?
4
All methods in an abstract class must be declared abstract.
What is the correct answer?
4
Which key word can protect a class in package from accessibility by the classes outside the package?
D. don't use any keyword at all(make it default)
What is the correct answer?
4
Any class may be inherited by another class in the same package.