Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.669 :

Posted: Wed Apr 11, 2018 6:10 am
by TwistedLizard
No special chars except $ and _ are allowed.
Seems the uk currency symbol £ is also allowed.

Code: Select all

class IdentifierTest{
  public static void main(String[] args) {
    int $ =1;
    int £ =2;
    int _ =3;
    System.out.println($);   //1
    System.out.println(£);   //2
    System.out.println(_);   //3
  }
}

Re: About Question com.enthuware.ets.scjp.v6.2.669 :

Posted: Wed Apr 11, 2018 10:36 pm
by admin
Yes, although the spec doesn't mention it explicitly here: https://docs.oracle.com/javase/specs/jl ... l.html#3.8

But documentation for Character.isJavaIdentifierStart say, "any currency symbol (such as "$")"