Alan Kaminsky
•
Department of Computer Science
•
Rochester Institute of Technology
•
4486
+
2220
= 6706
Home Page
Advanced Programming
•
4003-707-02
•
Fall Quarter 2008
Course Page
4003-707-02 Advanced Programming
Module 1. Objects -- Lecture Notes
Prof. Alan Kaminsky
Rochester Institute of Technology -- Department of Computer Science
Hello World
The "Hello world" program in Java
Java main programs
Source file name requirements
Use of objects in the "Hello world" program
Java program development
Editing
JDK documentation; Javadoc
Compiling
Running
JDK 1.5, JDK 1.6
Coding style
Object Concepts
Everything's an
object
(Except things like integers, characters, etc.)
A string is an object
An array is an object
An object has
state, behavior, and identity
-- Grady Booch
An object is an instance of a
class,
or
type
(Except for primitive types)
A string is an instance of class java.lang.String
An array is an instance of an implicit array class
A class is a member of a
class hierarchy
A class extends a
superclass
or
base class
The ultimate base class:
java.lang.Object
A class may have
subclasses
Class hierarchy for java.io.PrintStream
Class hierarchy for java.util.LinkedList
Generic
classes
An object is created by a
constructor
Returns a
reference
to the new object
An object is never explicitly destroyed
Objects for which all references have gone away are automatically destroyed by the
garbage collector
Today's Date Is
The "Today's date is" program in Java
Importing classes
Use of constructors
The
toString()
method
Variations
Use of temporary variables
Use of methods to extract information from an object --
information hiding
Use of string concatenation
Javadoc
Class comments
Method comments
The javadoc compiler
Advanced Programming
•
4003-707-02
•
Fall Quarter 2008
Course Page
Alan Kaminsky
•
Department of Computer Science
•
Rochester Institute of Technology
•
4486
+
2220
= 6706
Home Page
Copyright © 2008 Alan Kaminsky. All rights reserved. Last updated 02-Sep-2008. Please send comments to ark
@
cs.rit.edu.