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

    public class String_Example
    {
    public static void main(String args[])
    {
    char chars[] = {'I', 'L', 'U'};
    String obj = new String(chars);
    String obj1 = "InterviewMania";
    int len0 = obj1.length();
    int len1 = obj.length();
    System.out.println(len0 + " " + len1);
    }
    }
    1. 14 3
    2. 3 14
    3. 41 3
    4. 3 41
    5. None of these
Correct Option: A

Output: 14 3



Your comments will be displayed only after manual approval.