Skip to Content
Java 7 Pocket Guide, 2nd Edition
book

Java 7 Pocket Guide, 2nd Edition

by Patricia Liguori, Robert Liguori
July 2013
Intermediate to advanced
213 pages
3h 20m
English
O'Reilly Media, Inc.
Content preview from Java 7 Pocket Guide, 2nd Edition

Chapter 2. Lexical Elements

Java source code consists of words or symbols called lexical elements or tokens. Java lexical elements include line terminators, whitespace, comments, keywords, identifiers, separators, operators, and literals. The words or symbols in the Java programming language are comprised of the Unicode character set.

Unicode and ASCII

Maintained by the Unicode Consortium standards organization, Unicode is the universal character set with the first 128 characters being the same as those in the American Standard Code for Information Interchange (ASCII) character set. Unicode provides a unique number for every character, usable across all platforms, programs, and languages. Java SE 7 uses Unicode 6.0.0 and you can find more about it in the online manual. Java SE 6 and J2SE 5.0 use Unicode 4.0.

Tip

Java comments, identifiers, and string literals are not limited to ASCII characters. All other Java input elements are formed from ASCII characters.

The Unicode set version used by a specified version of the Java platform is documented in the Character class of the Java API. The Unicode Character Code Chart for scripts, symbols, and punctuation can be accessed at http://unicode.org/charts/.

Printable ASCII Characters

ASCII reserves code 32 (spaces) and codes 33 to 126 (letters, digits, punctuation marks, and a few others) for printable characters. Table 2-1 contains the decimal values followed by the corresponding ASCII characters for these codes.

Table 2-1. Printable ASCII characters ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java Pocket Guide

Java Pocket Guide

Robert Liguori, Patricia Liguori
The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar
Java Testing with Spock

Java Testing with Spock

Konstantinos Kapelonis

Publisher Resources

ISBN: 9781449343743Errata Page