Home
Current Affairs January 2024

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

Correct Answer :

B. False


Related Questions

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 panel can not be added to another panel.

A. True

B. False

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

Which of the following represent legal flow control statements?

A. break();

B. continue(inner);

C. return;

D. exit();

What is the correct answer?

4

DriverManager.getConnection("jdbc:odbc:dsn_name") method does not depend on the class.forName(...) method.

A. True.

B. False.

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

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

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

DataInput is

A. An abstract class defined is java.io.

B. A class we can use to read primitive data types.

C. An interface that defines methods to open files.

D. An interface that defines methods to read primitive data types.

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

Every method of a final in class is implicitly final.

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

Declarations can appear anywhere in the body of a Java method.

A. True

B. False

What is the correct answer?

4

The keywords reserved but not used in the initial version of Java re:

A. Synchronized

B. Boolean

C. union

D. goto

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

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

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

A package is a collection of

A. classes

B. interface

C. editing tools

D. classes and interfaces

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

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

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

We can add more than one class(es) at the time of compilation Java Beans.

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

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

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

A. True

B. False

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

Two methods cannot have the same name in Java.

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

In RMI before running the client program we must start RMI Registry.

A. True.

B. False.