public static boolean isAccessModifier(String str){
  return str.equals("static") || str.equals("public") || str.equals("protected")|| str.equals("private")|| str.equals("final")|| str.equals("transient");
}

public static boolean isAccessModifier ( String str ) { return str . equals ( "static" ) || str . equals ( "public" ) || str . equals ( "protected" ) || str . equals ( "private" ) || str . equals ( "final" ) || str . equals ( "transient" ) ; }
returns true if str is an access modifier , false otherwise .
