1. INT INTROD RODUCT UCTIO ION N a. Wh What at is Ja Java va Java is an object-oriented object-oriented programming programming language language developed by Sun Microsystems, a company best known for its high-end ni! workstations. workstations. the Java language was designed designed to be small, simple, simple, and portable across platforms and operating systems, both at the source and at the binary level. "he Java language language was developed developed at Sun Microsystems Microsystems in #$$# #$$# as part of a research project to develop software for consumer electronics devices%television devices%television sets, &'(s, toasters, and the other sorts of machines you can buy at any department store. Java)s goals at that time were to be small, fast, e*cient, and easily portable to a wide range of hardware devices. +t is those same goals that made Java an ideal language for distributing e!ecutable programs via the World Wide Web, and also a general-purpose programming language for developing programs that are easily usable and portable across dierent platforms.
"he Java development development environment environment has two parts parts a Java compiler compiler and a Java interpreter. "he Java compiler takes your Java program and instead of generating machine codes from your source les, it generates bytecodes.
"o "o run a Java program, program, you run run a program program called a bytecode bytecode interpreter, which in turn e!ecutes your Java program /see 0igure #.12. 3ou 3ou can either run run the interpreter interpreter by itself, itself, or%for or%for applets%there applets%there is a bytecode interpreter built into 4otJava and other Java-capable browsers that runs the applet for you.
Why go through all the trouble of adding this e!tra layer of the bytecode interpreter5 4aving your Java programs in bytecode form means that instead of being specic to any one system, your programs can be run on any platform and any operating or window system as long as the Java interpreter is available. "his capability of a single binary le to be e!ecutable across platforms is crucial to what enables applets to work, because the World Wide Web itself is also platform independent. Just as 4"M6 les can be read on any platform, so applets can be e!ecuted on any platform that is a Java-capable browser.
b. 7etting started with java 8 88888888888888888888888888888!!!!!
2. OOPS a. 9bjects and 'lasses 888888888888888888888888888888!!!!!
b. :ehavior and ;ttributes 888888888888888888888888888888!!!!!
c. +nheritance, +nterfaces and
d. 'reating a subclass 888888888888888888888888888888!!!!!
3. JAVA BASICS a. Statements and =!pressions 888888888888888888888888888888!!!!!
b. &ariables and >ata "ypes 888888888888888888888888888888!!!!!
c. 'omments 888888888888888888888888888888!!!!!
d. 6iterals 888888888888888888888888888888!!!!!
e. =!pressions and 9perators 888888888888888888888888888888!!!!!
f. String ;rithmatic
888888888888888888888888888888!!!!!
4. WORKING WITH OBJECTS a. 'reating new objects 888888888888888888888888888888!!!!!
b. ;ccessing and Setting 'lass and +nstance &ariables 888888888888888888888888888888!!!!!
c. 'alling Methods
888888888888888888888888888888!!!!!
d. (eferences to 9bjects 888888888888888888888888888888!!!!!
e. 'asting and 'onverting 9bjects and
888888888888888888888888888888!!!!!
f. 9dds and =nds 888888888888888888888888888888!!!!!
g. "he Java 'lass 6ibraries 888888888888888888888888888888!!!!!
5. ARRAYS, CONDITIONALS AND LOOPS a. ;rrays 888888888888888888888888888888!!!!!
b. :lock Statements 888888888888888888888888888888!!!!!
c. :reaking 9ut of 6oops 888888888888888888888888888888!!!!!
6. CREATING CLASSES AND APPLICATIONS IN JAVA a. >ening 'lasses 888888888888888888888888888888!!!!!
b. 'reating +nstance and 'lass &ariables 888888888888888888888888888888!!!!!
c. 'reating Methods 888888888888888888888888888888!!!!!
d. 'reating Java ;pplications
888888888888888888888888888888!!!!!
e. Java ;pplications and 'ommand 6ine ;rguments 888888888888888888888888888888!!!!!
7. ORE ABOUT ETHODS a. 'reating Methods with Same ?ame and >ierent ;rguments
888888888888888888888888888888!!!!!
b. 'onstructor Methods
888888888888888888888888888888!!!!!
c. 9verriding Methods
888888888888888888888888888888!!!!!
d. 0inali@er Methods
888888888888888888888888888888!!!!!
!. JAVA APPLET BASICS a. 4ow ;pplets and ;pplications are dierent
888888888888888888888888888888!!!!!
b. 'reating ;pplets
888888888888888888888888888888!!!!!
c. +ncluding an ;pplet on a Webpage
888888888888888888888888888888!!!!!
d. More about the A;ppletB tag
888888888888888888888888888888!!!!!
e.
888888888888888888888888888888!!!!!
". GRAPHICS, #ONTS AND COLOR a. "he 7raphics 'lass
888888888888888888888888888888!!!!!
b. >rawing and 0illing
888888888888888888888888888888!!!!!
c. "e!t and 0onts
888888888888888888888888888888!!!!!
d. 'olor
1$.
888888888888888888888888888888!!!!!
SIPLE ANIATION AND THREADS
a. 'reating ;nimation in Java
888888888888888888888888888888!!!!!
b. "hreads What they are and why you need them
888888888888888888888888888888!!!!!
c. (educing ;nimation 0licker
11.
888888888888888888888888888888!!!!!
ORE ANIATION, IAGES AND SOUND
a. (etrieving and using images
888888888888888888888888888888!!!!!
b. 'reating ;nimation using images
888888888888888888888888888888!!!!!
c. (etrieving and sing Sounds
888888888888888888888888888888!!!!!
d. Suns ;nimator ;pplet
888888888888888888888888888888!!!!!
e. More about 0licker >ouble C :uering
12.
888888888888888888888888888888!!!!!
ANAGING SIPLE EVENTS AND INTERACTIVITY
a. Mouse 'licks
888888888888888888888888888888!!!!!
b. Mouse Movements
888888888888888888888888888888!!!!!
c. Deyboard =vents
888888888888888888888888888888!!!!!
d. "he ;W" =vent 4andler
13.
888888888888888888888888888888!!!!!
THE JAVA ABSTRACT WINDOWING TOOLKIT
a. ;n ;W" 9verview 888888888888888888888888888888!!!!!
b. "he :asic ser +nterface 'omponents 888888888888888888888888888888!!!!!
c.
d. 4andling + ;ctions and =vents
888888888888888888888888888888!!!!!
e. ?esting
888888888888888888888888888888!!!!!
f. More + 'omponents
888888888888888888888888888888!!!!!
g. More + =vents
888888888888888888888888888888!!!!!
h. ; complete =!ample
888888888888888888888888888888!!!!!
14.
WINDOWS, NETWORKING AND OTHER TID% BITS
a. Windows, Menus and >ialog :o!es
888888888888888888888888888888!!!!!
b. ?etworking in Java
888888888888888888888888888888!!!!!
c. 9ther ;pplet 4ints 888888888888888888888888888888!!!!!
15.
ODI#IERS
a. Method and &ariable ;ccess 'ontrol
888888888888888888888888888888!!!!!
b. 'lass &ariables and Methods
888888888888888888888888888888!!!!!
c. "he nal Modier
888888888888888888888888888888!!!!!
d. ;bstract Methods and 'lasses
888888888888888888888888888888!!!!!
16.
PACKAGES AND INTER#ACES
a.
b. +nterfaces
888888888888888888888888888888!!!!!
17.
E&CEPTIONS
a.
888888888888888888888888888888!!!!!
b.
888888888888888888888888888888!!!!!
c. "he 6imitations
888888888888888888888888888888!!!!!
d. "he nally 'lause
888888888888888888888888888888!!!!!
1!.
ULTITHREADING
a. "he
888888888888888888888888888888!!!!!
b. "hinking Multithreaded
888888888888888888888888888888!!!!!
c. 'reating and sing "hreads
888888888888888888888888888888!!!!!
d. Dnowing When a "hread has stopped
888888888888888888888888888888!!!!!
e. "hread Scheduling
888888888888888888888888888888!!!!!
1".
STREAS
a. +nput Streams
888888888888888888888888888888!!!!!
b. 9utput Streams
888888888888888888888888888888!!!!!
c. (elated 'lasses
888888888888888888888888888888!!!!!
2$.
NATIVE ETHODS AND LIBRARIES
a. >isadvantages of ?ative methods
888888888888888888888888888888!!!!!
b. +llusion of (eEuired =*ciency
888888888888888888888888888888!!!!!
c. Writing native Methods
888888888888888888888888888888!!!!!
d. ; native 6ibrary
888888888888888888888888888888!!!!!
21.
UNDER THE HOOD
a. "he :ig
888888888888888888888888888888!!!!!
b. "he Java &irtual Machine
888888888888888888888888888888!!!!!
c. :ytecodes in More >etail
888888888888888888888888888888!!!!!
d. "he .class 0ile 0ormat
888888888888888888888888888888!!!!!
e. Method Signatures
888888888888888888888888888888!!!!!
a. "he 7arbage 'ollector 888888888888888888888888888888!!!!! b. "he Security Story 888888888888888888888888888888!!!!!