Examveda
Examveda

What will be the output of the following Java program?
class output 
{
    public static void main(String args[])
    { 
       String c = "  Hello World  ";
       String s = c.trim();
       System.out.println("\""+s+"\"");
    }
}

A. ""Hello World""

B. ""Hello World"

C. "Hello World"

D. Hello world

Answer: Option C


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings