Search
 
SCRIPT & CODE EXAMPLE
 

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);
    }
}
Comment

how to compare two characters in java

If your input is a character and the characters you are checking against are mostly consecutive you could try this:

if ((symbol >= 'A' && symbol <= 'Z') || symbol == '?') {
    // ...
}
Comment

java compare char

don't forget to use single quotes('char') in stead of double quotes("String") like with String.
Comment

PREVIOUS NEXT
Code Example
Java :: java string start with substring 
Java :: row and column sorted matrix 
Java :: lombok 
Java :: create thread 
Java :: java tamanho de um vetor 
Java :: import class from package java 
Java :: error: incompatible types: NonExistentClass cannot be converted to Annotation 
Java :: is string a primitive data type/use of getclass() 
Java :: Leap year or not program in java using if-else 
Java :: Java Enum ordinal() 
Java :: java gerüst 
Java :: iptc classification java code example 
Java :: spring amqp exchange not found 
Sql :: delete all data in neo4j 
Sql :: mysql last 7 days including today 
Sql :: ADD COLOUNS CREATED AND UPDATED AT IN MYSQL 
Sql :: redshift running queries 
Sql :: sql change column types 
Sql :: mysql force query to use index 
Sql :: mysql CURRENT_TIMESTAMP() 
Sql :: postgres kill running query 
Sql :: mac xampp mysql not starting 
Sql :: get current date in pyspark sql 
Sql :: sql add date hour 
Sql :: mysql 1 day ago 
Sql :: postgres install unaccent extension 
Sql :: how to check last gather stats on table in oracle 
Sql :: select password from user mysql 
Sql :: convert int to string in sql server 
Sql :: how to get non distinct values in sql 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =