-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
String str0 = " Interview mania ";
String str1 = str0.trim();
System.out.println("\""+str1+"\"");
}
}
-
- " Interview mania "
- "Interview mania"
- Interview mania
- Interviewmania
- None of these
Correct Option: B
trim() method is used to remove leading and trailing whitespaces in a string.