Related Questions
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
It is perfectly legal to refer to any instance variable inside of a static method.
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
The break statement is required in the default case of a switch selection structure.
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
Consider the following class definition.
Class Student extends String
{
}
What happens when we try to compile this class?
A. Will not compile because class body is not defined
B. Will not compile because class is not declared public
C. Will compile successfully.
D. Will not compile because String is abstract
What is the correct answer?
4
When we implement the Runnable interface, we must define the 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
It is an error to have a method with the same signature in both the super class and its subclass.
What is the correct answer?
4
A class may be both abstract and final.
What is the correct answer?
4
EJBs can be of the following type(s)
None of the above
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
A string object can not be modified after it is created.
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
executeUpdate automatically updates data because___________
A. auto commit is on, by default
B. It performs a hidden commit statement as well
What is the correct answer?
4
When the string objects are compared with ==, the result is true If the strings contain the same values.
What is the correct answer?
4
For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.
What is the correct answer?
4
The length of a string object 's1' can be obtained using the expression s1.length.
What is the correct answer?
4
It is an error if a class with one or more abstract methods is not explicitly declared abstract.
What is the correct answer?
4
The default case is always required in the switch selection structure.
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
In order to connect to a database through java program we must create _______-
A. Connection, Statement, ResultSet
What is the correct answer?
4
All methods in an abstract class must be declared abstract.
What is the correct answer?
4
DataInput is
A. An abstract class defined is java.io.
B. A class we can use to read primitive data types.
C. An interface that defines methods to open files.
D. An interface that defines methods to read primitive data types.
What is the correct answer?
4
Which javadoc tag is used to denote a comment for methods parameters?
What is the correct answer?
4
Connection, Statement are interfaces and ResultSet is a class.
What is the correct answer?
4
The methods wait() and noify() are defined in
What is the correct answer?
4
When we implement an interface method, it should be declared as public.
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 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.