From the course: Oracle Java Certification: 1. Data Types

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Java identifiers

Java identifiers - Java Tutorial

From the course: Oracle Java Certification: 1. Data Types

Start my 1-month free trial

Java identifiers

- [Instructor] In Java, identifiers are names. They can be names of variables, classes, interfaces, or members of classes or interfaces. For the exam, you'll need to be able to identify valid identifiers. There are three rules. It must begin with a letter, dollar symbol, or underscore. It cannot use special symbols other than dollar sign or underscore, and they cannot be Java reserved words. Let's practice applying those rules. Which of the following do you think are valid identifiers? The valid ones are on the left. They are valid because they don't violate any of the rules. Let's examine the invalid ones. 1infiniteLoop starts with a number, and that's the problem. Int is a Java reserved word with a special meaning. Public@ uses the at symbol, which is not allowed at all. So make sure you study identifier rules before your exam.

Contents