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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
TwistedLizard
Posts: 57
Joined: Sat Mar 01, 2014 1:48 pm
Contact:

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

Post 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
  }
}

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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 "$")"
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests