Home
Current Affairs January 2024

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

Correct Answer :

A. True


Related Questions

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

To delete a file, we can use an instance of class file.

A. True

B. False

What is the correct answer?

4

forName() is a static factory method

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

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

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

A method declared as static can not access non-static class members.

A. True

B. False

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

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

Which of the following represent legal flow control statements?

A. break();

B. continue(inner);

C. return;

D. exit();

What is the correct answer?

4

A catch can have comma-separated multiple arguments.

A. True

B. False

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

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

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

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

Which of the following statements are valid array declarations?

A. int number();

B. float average[];

C. double[] marks;

D. counter int[];

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

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

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

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

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 are the wrapper classes?

A. Random

B. Vector

C. Byte

D. all of the above

What is the correct answer?

4

An EJB is a server-side component that encapsulates the business logic of an application

A. True

B. False

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

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

Declaring a method synchronized guarantees that the deadlock cannot occur.

A. True

B. False