Home
Current Affairs January 2024

What is the correct answer?

4

When we implement the Runnable interface, we must define the method

A. start()

B. init()

C. runnable()

D. run()

Correct Answer :

D. run()


Related Questions

What is the correct answer?

4

Which of the following string can be used as mode string for creating a RandomAccessFile object?

A. "rw"

B. "wr"

C. "0"

D. 'w''

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

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

What is the correct answer?

4

If m and n are int type variables, what will be the result of the expression
'm % n' when m = -14 and n = -3?

A. 4

B. 2

C. -2

D. -4

What is the correct answer?

4

It is an error if a class with one or more abstract methods is not explicitly declared abstract.

A. True

B. False

What is the correct answer?

4

Servlet has ___________

A. init method

B. doGet(------) method

C. All of the above methods.

What is the correct answer?

4

With javadoc, which of the following denotes a javadoc comment?

A. //#

B. /*

C. /**

D. //**

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

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

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

JdbcOdbcDriver is an object of Object class

A. True

B. False

What is the correct answer?

4

The break statement is required in the default case of a switch selection structure.

A. True

B. False

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.

A. True

B. False

What is the correct answer?

4

The concept of multiple inheritance is implemented in Java by

A. extending two or more classes

B. extending one class and implementing one or more interfaces

C. all the above

What is the correct answer?

4

When present, package must be the first no comment statement in the file.

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

A panel can not be added to another panel.

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

Which of the following classes are available in the java.lang package?

A. Random

B. Stack

C. String Buffer

D. Vector

What is the correct answer?

4

Which of the following are the wrapper classes?

A. Random

B. Vector

C. Byte

D. all of the above

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

One the features of is that an array can store many different types of values.

A. True

B. False

What is the correct answer?

4

Declarations can appear anywhere in the body of a Java method.

A. True

B. False

What is the correct answer?

4

What is wrong in the following class definitions? 
abstract class print { 
abstract show();
}
class Display extends print {
}

A. Nothing is wrong

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

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.

D. The code is illegal.

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 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

All the bitwise operators have the same level of precedence in Java.

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

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