A

Admin • 802.91K Points
Coach

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);
}
}
  • (A) Hell
  • (B) Hello
  • (C) Worl
  • (D) World
  • Correct Answer - Option(A)
  • Views: 8
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.