1public class StringExample
2{
3 public static void main(String[] args)
4 {
5 String blogName = "howtodoinjava.com";
6
7 System.out.println( blogName.startsWith("how") ); //true
8
9 System.out.println( "howtodoinjava.com".startsWith("howto") ); //true
10
11 System.out.println( "howtodoinjava.com".startsWith("hello") ); //false
12 }
13}
14
1public class StringExample
2{
3 public static void main(String[] args)
4 {
5 String blogName = "howtodoinjava.com";
6
7 blogName.startsWith(null);
8 }
9}
10