Home
Current Affairs January 2024

What is the correct answer?

4

Declaring a method synchronized guarantees that the deadlock cannot occur.

A. True

B. False

Correct Answer :

A. True


Related Questions

What is the correct answer?

4

In RMI we invoke client method from remote server

A. True

B. False

What is the correct answer?

4

Submit button always fires doPost(...)

A. True

B. False

What is the correct answer?

4

Which of the following keywords are used to control access to a class member?

A. default

B. protected

C. interface

D. None of the above

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

A catch can have comma-separated multiple arguments.

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

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

A. True

B. False

What is the correct answer?

4

If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value 15 to x.

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

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?

A. Error. Won't compile

B. Division by zero

C. Catch block

D. Division by zero catch block

What is the correct answer?

4

The modulus operator (%) can be used only with Integer operands.

A. True

B. False

What is the correct answer?

4

All methods in an abstract class must be declared abstract.

A. True

B. False

What is the correct answer?

4

Which of the following methods can be used to remove a component from the display?

A. remove()

B. desappear()

C. hide()

D. move()

What is the correct answer?

4

Connection, Statement are interfaces and ResultSet is a class.

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

Java always provides a default constructor to a class.

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

Two methods cannot have the same name in Java.

A. True

B. False

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

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

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

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

Which of the following methods can be used to change the size of a
size() *
resize()

A. component

B. dimension()

C. setSize()

D. size()

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

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

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

A final class may not have any abstract method.

A. True

B. False

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

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

Java is fully object oriented programme.

A. true

B. false