[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[On Teaching and Learning]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.5 API]
[Espresso]
[TAO of Java]
[CS152 2004F]
[CS152 2005S]
[CS152 2005F]
Back to Javadoc. On to Object Basics (2).
Held: Tuesday, February 21, 2006
Summary:
Today we begin the study of classes, the primary building
blocks of Java programs. As you've seen, classes can provide the
main
method. However, most classes serve instead as
molds for creating new objects.
Related Pages:
Assignments
Overview:
package yourname.naturalgruoping; import ClassWhoseNameYouDontWantToTypeInFull; /** * A helpful introductory comment that describes the class. */ public class ClassName { // Field declarations // Constructors // Methods } // class ClassName
public
). + The type of value the method returns. You can use
void
when a method doesn't return anything.
String name;
anywherein the class; variables are available only in the method they are declared in.
this
.
public String getName() { return this.name; } // getName() public void setName(String newName) { this.name = newName; } // setName(String)
Back to Javadoc. On to Object Basics (2).
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[On Teaching and Learning]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.5 API]
[Espresso]
[TAO of Java]
[CS152 2004F]
[CS152 2005S]
[CS152 2005F]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 9 08:31:35 2006.
The source to the document was last modified on Thu Jan 12 14:58:06 2006.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2006S/Outlines/outline.18.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby