I am taking Java fundamental course and I've came up with a confused character i.e # on assigning variable name on Java lately. I have surfed the internet a lot but all I could find is only oprerators, keyword and reserved words are not allowed. so why is # not allowable on variable name in Java. Example - total # is not allowed as a variable name.
Thanks in advance.
Jump to Post
Simply follow my second link (also first link works) to find the information you are seeking for. Letter # is indirectly excluded from to be legal for identifiers in both methods isJavaIdentifierStart(int) and isJavaIdentifierPart(int) of Character class. There you can find the exact rules which letters are allowed for constructing …
All 7 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.