Examveda
Examveda

What will be the output of the following Java program?
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

Answer: Option A


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings