Basic Language Constructs

This section introduces Java language basics that will aid you in the creation of applets. Tables 36.1 through 36.4 summarize Java's basic language constructs. Table 36.1 shows the data types available for variables and constants. Table 36.2 shows the operators available for manipulating those variables and constants. Table 36.3 shows the major statements of the language, used for controlling the flow of execution through the program. The last table, Table 36.4, shows three ways to add comments to your program.

Table 36.1. Basic Language Constructs (Java Types)
Type Example Notes
boolean boolean flag = false; A Java boolean is just true or false. It cannot be cast to char or int.
char char c[] = { 'A','\ uu42','C'} ; ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.