Home » JAVA Programming » Strings » Question
  1. What is the output of this program?

    public class string_Example
    {
    public static void main(String args[])
    {
    String obj = "I " + "like " + "Interview Mania ";
    System.out.println(obj);
    }
    }
    1. Interview Mania
    2. InterviewMania
    3. i like
    4. like Interview
    5. I like Interview Mania
Correct Option: E

Java defines an operator +, it is used to concatenate strings.
output: I like Interview Mania



Your comments will be displayed only after manual approval.