is Hexadecimal Digit - Java java.lang

Java examples for java.lang:char

Description

is Hexadecimal Digit

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        char c = 'a';
        System.out.println(isHexadecimalDigit(c));
    }//from w  ww . j  a  v  a 2  s .  com

    public static boolean isHexadecimalDigit(char c) {
        return Character.isDigit(c) || (c >= 'a' && c <= 'f')
                || (c >= 'A' && c <= 'F');
    }
}

Related Tutorials