Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
Java Prog Lesson 02

Java Prog Lesson 02

Ratings: (0)|Views: 3|Likes:
Published by Madhavan Jayaraman

More info:

Published by: Madhavan Jayaraman on Jul 04, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/04/2012

pdf

text

original

 
Lesson 2
 – Basic Java Concepts Java
Programming
Copyright © 2003 Jeremy Russell & Associates Lesson 2 - Page 1 of 18
Copyright
©
Jeremy Russell & Associates, 2003. All rights reserved.
JPROG2-1
0
 
2
Basic Java Concepts
 
Schedule: Timing Topic45 minutes Lecture15 minutes Lab60 minutes Total
 
Java
Programming Lesson 2
 – Basic Java Concepts
Page 2 of 18
Lesson 2 Copyright © 2003 Jeremy Russell & Associates
JPROG2-2
Copyright
©
Jeremy Russell & Associates, 2003. All rights reserved.
Objectives
After completing this lesson, you will havean understanding of:
 –Important elements of a Java program –Basic Java language syntax –.java and .class file structures –How to run a Java application
 
Objectives
Lesson 2 introduces key elements of the language for Java class creation.Basic syntax is also demonstrated, together with coding and documentation standards.The JDK is described in more detail to allow creation, compilation and running of simple Javaprograms.
 
Lesson 2
 – Basic Java Concepts Java
Programming
Copyright © 2003 Jeremy Russell & Associates Lesson 2 - Page 3 of 18
JPROG2-3
Copyright
©
Jeremy Russell & Associates, 2003. All rights reserved.
Sun’s JDK
The Sun JDK includes "standard" classesThe language package is in
classes.zip
Other packages included are:
 – Windowing (
java.swing
) – Applet (
java.applet
) – Streams I/O (
java.io
) – Network comms (
java.net
)
 
Sun’s JDK
The Java Developers Kit (JDK) (introduced in Lesson 1) includes a standard set of classes thatprovide the core functions of Java. The language package (
java.lang
) contains the lowest level of required classes. For example,
java.lang
includes the
Object
class, the foundation of all userdefined (and many Java defined) classes.The JDK includes several
 packages
(groups of classes) that share common definitions. Packages alsoshare a
name space
, the scope of internal definitions within the package. Different packages cancontain objects of the same name
– the fully qualified object name includes the package name foruniqueness. To simplify coding, a package can be imported into a class (discussed later), whichremoves the requirement to fully name packaged objects.
Included packages
Some examples of included packages are:

java.lang
Object, String, Thread, System, Math

javax.swing
Window, Button, Menu, Font, Border

java.applet
Applet, AudioClip,

java.io
InputStream, OutputStream, File, StreamTokenizer

java.net
Socket, URL, ContentHandlerFurther information should be obtained from the JavaSoft website, from where the documentation canbe browsed or downloaded. The download is an (approximately) 21.5mb ZIP file, which can then beunzipped into a set of HTML pages for use in any browser.Alternatively, if you have access to a permanent Internet connection, the latest documentation can bebrowsed online.The URL for documentation is
http://java.sun.com/j2se/1.3/docs.html.
 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->