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);
}
}
a) Hello
b) World
c) Helloworld
d) Hello World
Answer: d
Explanation: append() method of class StringBuffer is used to concatenate the string representation to the end of invoking string.
Output:
Hello World
Related Posts
Which of the following is the most complete cloud computing service model?
Rackspace Cloud Service is an example of _____________
Amazon Web Services offers a classic Service Oriented Architecture (SOA) approach to ______________
_______ provides virtual machines, virtual storage, virtual infrastructure, and other hardware assets.
__________ is the most refined and restrictive service model.
Which of the following can be considered PaaS offering?
Point out the wrong statement.
Join The Discussion