Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Java program?
class string_demo
{
public static void main(String args[])
{
String obj = “I” + “like” + “Java”;
System.out.println(obj);
}
}

What will be the output of the following Java program?
class string_demo
{
public static void main(String args[])
{
String obj = “I” + “like” + “Java”;
System.out.println(obj);
}
}
a) I
b) like
c) Java
d) IlikeJava

Answer: d
Explanation: Java defines an operator +, it is used to concatenate strings.

Join The Discussion