Answers for "character comparison java"

0

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);
    }
}
Posted by: Guest on April-06-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language