Consider the following Java code snippet: public class Main { public static…

PYQ IBPS SO CRP SPL-XIII (2023)

Consider the following Java code snippet:

public class Main
{
   public static void main(String[] args)
   {
       String str = "2237\u3456\u7891" + "011";
       int length = str.length();

       System.out.println("Length of the string : " + length);
   }
}

What will be the output of the program?

  1. A.

    Length of the string : 19

  2. B.

    Length of the string : 13

  3. C.

    Length of the string : 17

  4. D.

    Length of the string : 9

  5. E.

    Compilation Error

Attempted by 107 students.

Sign up free to check your answer

Sign up free

Explore the full course: Ibps So It Mains

Loading lesson…