-
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);
System.out.println(obj);
}
}
-
- ILU
- ULI
- IUL
- LUI
- LIU
Correct Option: A
String(chars) is a constructor of class string, it initializes string obj with the values stored in character array chars, therefore obj contains “ILU”.