is Symbol - Java java.lang

Java examples for java.lang:char

Description

is Symbol

Demo Code


//package com.java2s;

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

    public static boolean isSymbol(char c) {
        return c == '/' || c == '.' || c == '&' || c == '|' || c == '-'
                || c == '+' || c == '=' || c == '<' || c == '>' || c == '!'
                || c == '?' || c == '~' || c == '[' || c == ']' || c == '{'
                || c == '}' || c == ',' || c == ';' || c == ':' || c == '$'
                || c == '=' || c == '*' || c == '%' || c == '^' || c == '('
                || c == ')';
    }
}

Related Tutorials