Advertisement
iamaamir

Java Identifier

Aug 30th, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. package TimePass;
  2.  
  3. /**
  4.  *
  5.  * @author toffe boy Aamir
  6.  
  7. Determines if the specified character may be part of a Java identifier as other than the first character.
  8. A character may be part of a Java identifier if any of the following are true:
  9. ○ it is a letter
  10. ○ it is a currency symbol (such as '$')
  11. ○ it is a connecting punctuation character (such as '_')
  12. ○ it is a digit
  13. ○ it is a numeric letter (such as a Roman numeral character)
  14. ○ it is a combining mark
  15. ○ it is a non-spacing mark
  16.  
  17.  
  18.  */
  19. public class JavaIdentifierPart {
  20.  
  21.     public static void main(String[] args) {
  22.         char c;
  23.         System.out.println("Java Identifier Part");
  24.         for (c = '\u0041'; c <= '\u005a'; c++) {
  25.             boolean javaIdentifierPart = Character.isJavaIdentifierPart(c);
  26.             System.out.format("%c, %b\n", c, javaIdentifierPart);
  27.  
  28.         }
  29.        
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement