R
Q. What will be the output of the following Java program?
Code:
class output
{
public static void main(String args[])
{
String s1 = "Hello World";
String s2 = s1.substring(0 , 4);
System.out.println(s2);
}
}
{
public static void main(String args[])
{
String s1 = "Hello World";
String s2 = s1.substring(0 , 4);
System.out.println(s2);
}
}
- Correct Answer - Option(A)
- Views: 17
- Filed under category JAVA
Discusssion
Login to discuss.