Java Reference
In-Depth Information
Table 1.4
List of Java Keywords
abstract
continue
for
new
switch
assert
default
goto
package
synchronized
boolean
do
if
private
this
break
double
implements
protected
throw
byte
else
import
public
throws
case
enum
instanceof
return
transient
catch
extends
int
short
try
char
final
interface
static
void
class
finally
long
strictfp
volatile
const
float
native
super
while
A Complex Example: DrawFigures1
The println statement can be used to draw text figures as output. Consider the fol-
lowing more complicated program example (notice that it uses two empty println
statements to produce blank lines):
1 public class DrawFigures1 {
2 public static void main(String[] args) {
3 System.out.println(" /\\");
4 System.out.println(" / \\");
5 System.out.println(" / \\");
6 System.out.println(" \\ /");
7 System.out.println(" \\ /");
8 System.out.println(" \\/");
9 System.out.println();
10 System.out.println(" \\ /");
11 System.out.println(" \\ /");
12 System.out.println(" \\/");
13 System.out.println(" /\\");
14 System.out.println(" / \\");
15 System.out.println(" / \\");
16 System.out.println();
17 System.out.println(" /\\");
18 System.out.println(" / \\");
19 System.out.println(" / \\");
20 System.out.println("+------+");
21 System.out.println("| |");
22 System.out.println("| |");
23 System.out.println("+------+");
24 System.out.println("|United|");
25 System.out.println("|States|");
26 System.out.println("+------+");
27 System.out.println("| |");
 
 
Search WWH ::




Custom Search