Home
Current Affairs January 2024

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

Correct Answer :

D. int short


Related Questions

What is the correct answer?

4

The check box group class is a subclass of the component class.

A. True

B. False

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

Consider the following statements:
int x = 10, y = 15; 
x = ((x < y) ? (y + x) : (y - x);

What will be the value of x after executing these statements?

A. 25

B. 15

C. 5

D. Error can't be executed.

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

Which of the following represent legal flow control statements?

A. break();

B. continue(inner);

C. return;

D. exit();

What is the correct answer?

4

When the string objects are compared with ==, the result is true If the strings contain the same values.

A. True

B. False

What is the correct answer?

4

The length of a string object 's1' can be obtained using the expression s1.length.

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

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

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

Which of the following statements are true?

A. UTF characters are all 24 bits.

B. Reader class has methods that can read integers and floats.

C. Unicode characters are all 16 bits.

D. all of the above

What is the correct answer?

4

class.forName(...) creates an instance of java ODBC driver

A. True

B. False

What is the correct answer?

4

Frames and applets cannot be used together in the same program.

A. True

B. False

What is the correct answer?

4

In evaluating a logical expression of type 'Boolean expression 1&& Boolean expression 2', both the Boolean expressions are not always evaluated.

A. True

B. False

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

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

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

In a single Servlet class we can use____________

A. doGet(...) method only

B. doPost(...) method only

C. doGet(...) method and doPost(...) method both at a time.

D. Either 'a' or 'b'

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

Submit button always fires doPost(...)

A. True

B. False

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

C. Does not commit

D. None of the above.

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

Which of the following will produce a value of 22 if x=22.9:

A. Ceil(x)

B. Round(x)

C. Rint(x)

D. Abs(x)

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

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

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

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

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

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

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

A. True

B. False