Home

What is the correct answer?

4

Given the code
String s = new String("abc");
Which of the following calls are valid?

A. s.toUpperCase()

B. s.append("xyz")

C. s.setCharAt(1<'A')

D. all of the above

Correct Answer :

A. s.toUpperCase()


Related Questions

When present, package must be the first no comment statement in the file. Session bean An EJB is a server-side component that encapsulates the business logic… What is wrong in the following class definitions? abstract class… What is error in the following class definitions? abstract class… The break statement is required in the default case of a switch selection… Declaring a method synchronized guarantees that the deadlock cannot occur. executeUpdate(------------) returns ___________ Which of the following methods can be used to draw the outline of a square? The expression (x == y && a<b) is true If either x == y is true or… We can add more than one class(es) at the time of compilation Java Beans. Message-Driven beans act as a listener for the Java Message Service API,… Consider the following class definitions: class maths { student student1;… To delete a file, we can use an instance of class file. The modulus operator (%) can be used only with Integer operands. Which of the following methods can be used to change the size of a size()… Connection, Statement are interfaces and ResultSet is a class. We can over load methods with differences only in their return type. One the features of is that an array can store many different types of… A thread can make second thread ineligible for execution by calling the… Which of the following string can be used as mode string for creating… Objects are passed to a method by use of call-by-reference. A method declared as static can not access non-static class members. It is perfectly legal to refer to any instance variable inside of a static… DataInput is When we implement the Runnable interface, we must define the method When X is a positive number the operations x>> 2 and x>>>2… Which of the following command lines options generates documentation for… It is perfectly legal to assign a subclass object to a supper class reference. A JSP file can be stored_________________