Author: AlinaIoana Florea
Exam Permalink:
https://www.jobilize.com/java-certification-questions
Question Permalink:
https://www.jobilize.com/legal-java-identifiers
Question 279 / 297:  Which of the following are NOT LEGAL Java identifiers according to the "java language specification"?
Choose 4
int αρετη;                   // line 1

int ______9_y; // line 2

int €a; // line 3

int £b_, ₤c; // line 4

int this_is_a_way_too_long_name_for_an_identifier; // line 5

int d3#; // line 6

int -e, 7g, :h; // line 7

float .f; // line 8

double _$_$; // line 9

int true = 10; // line 10

int null = 4; // line 11

int foo = 3; // line 12

int Foo = 3; // line 13

int continue = 6; // line 14

int Volatile = 6; // line 15

public abstract void addEvent(); // line 16

<< First < Previous Next > Last >>
Explanation:

LEGAL/VALID Java identifiers:

- are made ONLY from these Unicode characters:

letters(upper/lowercase)

digits(0-9)

the underscore(_)

currency symbols($, €, £, ₤ etc.)

- MUST NOT START with a digit

- are case-sensitive(Volatile != volatile)

- there is NO limit to how long they ca be

- MUST NOT be a: boolean literal(true, false), Null literal(null),

nor any of Java's 50 keywords(abstract, assert, boolean, break, byte, case, catch, char, class, const, continue, default, do, double, else, enum, extends, final, finally, float, for, goto, if, implements, import, instanceof, int, interface, long, native, new, package, private, protected, public, return, ..., volatile, while)

_____________________________________

=> "#", ".", "-", ":", "null", "true" and "continue" will NOT compile.

line 16 - the question is asking about valid Java(not JavaBeans) indentifiers

Exam Home Page
https://www.jobilize.com/java-certification-questions

Oracle Certified Professional Java Programmer

Author:

Access: Public Instant Grading

Ask
Nicole Bartels
Start Quiz
Marion Cabalfin
Start Test
Donyea Sweets
Start Test
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>