public static boolean isConstantName(String name){
  return Pattern.matches("[\\dA-Z_]+",name);
}

public static boolean isConstantName ( String name ) { return Pattern . matches ( "[\\dA-Z_]+" , name ) ; }
checks if given name is a constant name i . e if the name contains all caps and underscores only
