Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

character comparison java

public static void compareCharacters(char c1,char c2){
	int cmp=Character.compare(c1,c2);
  	if(cmp>0){
    	System.out.println(c1+">"+c2);
    }else if(cmp<0){
    	System.out.println(c1+"<"+c2);
    }else{
    	System.out.println(c1+"="+c2);
    }
}
 
PREVIOUS NEXT
Tagged: #character #comparison #java
ADD COMMENT
Topic
Name
8+6 =