Related Questions
What is the correct answer?
4
It is perfectly legal to assign a subclass object to a supper class reference.
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
A static class method can be invoked by simply using the name of the method alone.
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 represent legal flow control statements?
What is the correct answer?
4
We can over load methods with differences only in their return type.
What is the correct answer?
4
Which of the following methods can be used to change the size of a
size() *
resize()
What is the correct answer?
4
If you want to assign a value of 99 to the variable year, then which of the following lines can be used within an <applet> tags?
A. number=getParameter(99)
D. <param = radius value ==99>
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
The methods wait() and noify() are defined in
What is the correct answer?
4
An EJB is a server-side component that encapsulates the business logic of an application
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
class.forName(...) creates an instance of java ODBC driver
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
Which of the following will produce a value of 22 if x=22.9:
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
The programmer must explicitly create the system .in and system .out objects.
What is the correct answer?
4
JSP files creates ________________
B. html files and java files
C. java files and class files
What is the correct answer?
4
A method declared as static can not access non-static class members.
What is the correct answer?
4
It is perfectly legal to refer to any instance variable inside of a static method.
What is the correct answer?
4
Java is fully object oriented programme.
What is the correct answer?
4
Frames and applets cannot be used together in the same program.
What is the correct answer?
4
Which are the valid ways to create DataInputStream streams?
A. new DataInputStream(new File("in.dat"));
B. new DataInputStream(new FileInputStream("in.dat"));
C. new DataInputStream("in.dat");
D. new DataInputStream("in.data","r");
What is the correct answer?
4
Members of a class specified as private are accessible only to the methods of the class.
What is the correct answer?
4
Declaring a method synchronized guarantees that the deadlock cannot occur.
What is the correct answer?
4
When we implement the Runnable interface, we must define the method
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
A Java monitor must either extend thread class or implement Runnable interface.
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
It is an error to have a method with the same signature in both the super class and its subclass.