Home
Current Affairs January 2024

What is the correct answer?

4

What is error in the following class definitions? 
abstract class xy { 
abstract sum(int x, int y) {
}
}

A. class header is not define properly

B. constructor is no defined

C. method is not defined properly

D. no error

Correct Answer :

C. method is not defined properly


Related Questions

What is the correct answer?

4

Any method in a supper class can be over ridden in its subclass.

A. True

B. False

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

C. both

D. neither

What is the correct answer?

4

Every method of a final in class is implicitly final.

A. True

B. False

What is the correct answer?

4

JSP files creates ________________

A. html files

B. html files and java files

C. java files and class files

D. None of the above.

What is the correct answer?

4

In the code below, what data types the variable x can have?

A. byte b1 = 5;

B. byte b2 = 10;

C. x = b1 * b2;

D. int short

What is the correct answer?

4

A constructor must always invoke its supper class constructor in its first statement.

A. True

B. False

What is the correct answer?

4

Which of the following methods belong to the String class?

A. length()

B. compareTo()

C. substring()

D. all of the them

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?

A. private

B. protected

C. public

D. private protected

What is the correct answer?

4

A thread can make second thread ineligible for execution by calling the suspend (-) method on second thread.

A. True

B. False

What is the correct answer?

4

Two methods cannot have the same name in Java.

A. True

B. False

What is the correct answer?

4

For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.

A. True.

B. False.

What is the correct answer?

4

When we invoke repaint () for a Component, the AWT invokes the method:

A. draw()

B. update()

C. show()

D. paint()

What is the correct answer?

4

The use of protected keyword to a member in a class will restrict its visibility as follows:

A. Visibility only in the class and its subclasses in the same package.

B. Visibility only inside the same package.

C. Visibility in all classes in the same package and subclasses in other packages.

D. Visibility only in the class where it is declared.

What is the correct answer?

4

A static class method can be invoked by simply using the name of the method alone.

A. True

B. False

What is the correct answer?

4

A JSP file can be stored_________________

A. With the extension .jsp in servlets folder of the jws

B. With the extension .html in public_html folder of the jws

C. With the extension .jsp in public_html folder of the jws

D. None of the above.

What is the correct answer?

4

The keywords reserved but not used in the initial version of Java re:

A. Synchronized

B. Boolean

C. union

D. goto

What is the correct answer?

4

executeUpdate(------------) returns ___________

A. Nothing

B. Returns a ResultSet object

C. Returns an integer value to show the no. of updated rows

D. None of the above.

What is the correct answer?

4

Every call to wait has a corresponding call to notify that will eventually end the wafting.

A. True

B. False

What is the correct answer?

4

putValue(...) method takes _____________________-

A. Two arguments of object type

B. First one is of a character type and second one is of an object type

C. First one is of an object type and second one is of a character type

D. None of the above.

What is the correct answer?

4

It is perfectly legal to assign a subclass object to a supper class reference.

A. True

B. False

What is the correct answer?

4

Which of the following methods can be used to draw the outline of a square?

A. fillRect()

B. drawLine()

C. drawString()

D. all of the above

What is the correct answer?

4

A catch can have comma-separated multiple arguments.

A. True

B. False

What is the correct answer?

4

To delete a file, we can use an instance of class file.

A. True

B. False

What is the correct answer?

4

Any class may be inherited by another class in the same package.

A. True

B. False

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.

D. all of the above

What is the correct answer?

4

Which javadoc tag is used to denote a comment for methods parameters?

A. @method

B. @parameter

C. @argument

D. @param

What is the correct answer?

4

Declaring a method synchronized guarantees that the deadlock cannot occur.

A. True

B. False

What is the correct answer?

4

The name of a Java program file must match the name of the class with the extension Java.

A. True

B. False

What is the correct answer?

4

We can over load methods with differences only in their return type.

A. True

B. False

What is the correct answer?

4

The setBackground() method is part of the class

A. Applet

B. Component

C. Container

D. Object