Home
Current Affairs January 2024

What is the correct answer?

4

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

A. True

B. False

Correct Answer :

A. True


Related Questions

What is the correct answer?

4

forName() is a static factory method

A. True

B. False

What is the correct answer?

4

Which exception is thrown by the read() method of InputStream class?

A. IOException

B. FileNotFoundException

C. ReadException

D. None of the above

What is the correct answer?

4

It is perfectly legal to refer to any instance variable inside of a static method.

A. True

B. False

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

Every method of a final in class is implicitly final.

A. True

B. False

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

A package is a collection of

A. classes

B. interface

C. editing tools

D. classes and interfaces

What is the correct answer?

4

Which of the following are not keywords?

A. NULL

B. Implements

C. Protected

D. None of the above

What is the correct answer?

4

Give file is a file object, which of the following are legal statements to create a new file.

A. file.create();

B. FileOutputStream fos=new FileOutputStream(file);

C. FileInputStream fis=new FileInputStream(file);

D. all of the above

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

The expression (x == y && a<b) is true If either x == y is true or a<b is true.

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

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

In RMI we invoke client method from remote server

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

Which of the following command lines options generates documentation for all classes and methods?

A. -protected

B. -public

C. -private

D. -encoding

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

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

A. True

B. False

What is the correct answer?

4

A class may be both abstract and final.

A. True

B. False

What is the correct answer?

4

Which of the following will produce a value of 10 if x = 9.7?

A. floor(x)

B. abs(x)

C. rint(x)

D. round(x)

What is the correct answer?

4

The import statement is always the first no comment statement in a Java program files.

A. True

B. False

What is the correct answer?

4

EJBs can be of the following type(s)
None of the above

A. Entity Bean

B. Session Bean

C. Message-driven bean

D. All of the above

What is the correct answer?

4

When we implement an interface method, it should be declared as public.

A. True

B. False

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

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

Throwing an exception always causes program termination.

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

In order to connect to a database through java program we must create _______-

A. Connection, Statement, ResultSet

B. Connection, ResultSet

C. Statement< ResultSet

D. Connection, Statement

What is the correct answer?

4

The programmer must explicitly create the system .in and system .out objects.

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