Examveda
Examveda

What will be the output of the following Java code?
class output 
{
    public static void main(String args[])
    { 
       String c = "Hello i love java";
       int start = 2;
       int end = 9;
       char s[]=new char[end-start];
       c.getChars(start,end,s,0);
       System.out.println(s);
    }
}

A. Hello, i love java

B. i love ja

C. lo i lo

D. llo i l

Answer: Option D


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings