-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
String ch = "hello i love interview mania";
boolean var0;
var0 = ch.startsWith("hello");
System.out.println(var0);
}
}
-
- Hello
- hello
- false
- true
- None of these
Correct Option: D
startsWith() method is case sensitive “hello” and “Hello” are treated differently, hence true is stored in var0.