This is program to explain the method of class String and StringBuffer in java.lang Package
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package filedemo;
/**
*
* @author Saeed
*/
public class StringDemo {
public static void main(String args[]){
String s1="saeed";
String s2="saeed";
System.out.println(s2.compareTo(s1));
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package filedemo;
/**
*
* @author Saeed
*/
public class StringDemo {
public static void main(String args[]){
String s1="saeed";
String s2="saeed";
System.out.println(s2.compareTo(s1));
}
}
No comments:
Post a Comment