Home
Current Affairs January 2024

What is the correct answer?

4

Consider the following class definition.
Class Student extends String
{
}
What happens when we try to compile this class?

A. Will not compile because class body is not defined

B. Will not compile because class is not declared public

C. Will compile successfully.

D. Will not compile because String is abstract

Correct Answer :

D. Will not compile because String is abstract


Related Questions

What is the correct answer?

4

Consider the following class definition.
Class Student extends String
{
}
What happens when we try to compile this class?

A. Will not compile because class body is not defined

B. Will not compile because class is not declared public

C. Will compile successfully.

D. Will not compile because String is abstract

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 modulus operator (%) can be used only with Integer operands.

A. True

B. False

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

The name of the RMI compiler is ___________

A. rmicom

B. rmic

C. jrmi

D. none of the above

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 are not keywords?

A. NULL

B. Implements

C. Protected

D. None of the above

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

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

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

Java is fully object oriented programme.

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

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

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

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

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

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

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

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

A package is a collection of

A. classes

B. interface

C. editing tools

D. classes and interfaces

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

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 RMI we invoke client method from remote server

A. True

B. False

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

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

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

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 check box group class is a subclass of the component class.

A. True

B. False

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

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