String myStr1 ="Hello";String myStr2 ="Hello";System.out.println(myStr1.compareTo(myStr2)); // Returns 0 because they are equalSystem.out.println("be".compareTo("bee"));
0
-1
join()
String date =String.join("/","30","04","2021"); System.out.print(date);String time =String.join(":","12","10","10"); System.out.println(" "+time);
30/04/2021 12:10:10
split()
String[] strings ="30-04-2021".split("-");for (int i =0; i <strings.length; i++)System.out.print(strings[i] +" ");