Back To Java String Class Index
//program to demonstrate compareto method of String class public class stringcompareto { public static void main(String args[]) { String a=new String("abc"); String b=new String("dfe"); int c; c=b.compareTo(a); System.out.println("value after comparing two strings is " + c ); } }