a) Byte b) Integer c) Array d) Class
View Question
What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer(“Hello”);
StringBuffer s2 = s1.reverse();
System.out.println(s2);
}
}
What will be the output of the following Java program? class output ...
View Question
What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
StringBuffer c = new StringBuffer(“Hello”);
StringBuffer c1 = new StringBuffer(” World”);
c.append(c1);
System.out.println(c);
}
}
What will be the output of the following Java program? class output ...
View Question
What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
StringBuffer c = new StringBuffer(“Hello”);
c.delete(0,2);
System.out.println(c);
}
}
What will be the output of the following Java program? class output ...
View Question
What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
String a = “hello i love java”;
System.out.println(a.indexOf(‘e’)+” “+a.indexOf(‘a’)+” “+a.lastIndexOf(‘l’)+” “+a.lastIndexOf(‘v’));
}
}
What will be the output of the following Java program? class output ...
View QuestionWhich of the following statement is correct?
a) reverse() method reverses all characters b) reverseall() method reverses ...
View Question
What is the string contained in s after following lines of Java code?
StringBuffer s new StringBuffer(“Hello”);
s.deleteCharAt(0);?
What is the string contained in s after following lines of Java code? StringBuffer s new StringBuffer("Hello"); s.deleteCharAt(0);?
View QuestionWhich of these method of class StringBuffer is used to find the length of current character sequence?
a) length() b) Length() c) capacity() d) Capacity() Answer: a Explanation: length()
View QuestionWhich of this method of class StringBuffer is used to concatenate the string representation to the end of invoking string?
a) concat() b) append() c) join() d) concatenate() Answer: b Explanation: append()
View QuestionWhich of these class is used to create an object whose character sequence is mutable?
a) String() b) StringBuffer() c) String() & StringBuffer() d) None of the mentioned Answer: b Explanation: StringBuffer represents ...
View Question