Ismail qouiqa 28 Jan 2020

Naming pattern

Naming your java components has to respect a certain pattern otherwise your code won't compile. The pattern states that your identifier must begin with letters [A-Z]underscore (_) or Dollar ($) symbols. Starting your component name with a number isn't possible. you also aren't allowed to use special characters like @!* and Reserved java key words like public private and so one.

Valid identifiers

  • public void Ok1453$4z_(int a) // here we have a method
  • private int _eaze445ae // here we have a variable
  • public class $_aezae54_ // here we have class

Invalid identifiers

  • Ok@1453$4z_ (it contains @)
  • 1_eaze445ae (it starts with 1)
  • public, private (java reserved keyword)