[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]
Back to Numeric Values in Java. On to Object Basics (2).
Held: Tuesday, February 8, 2005
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:
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 Numeric Values in Java. 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]
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 Wed May 11 10:55:48 2005.
The source to the document was last modified on Mon Jan 24 10:17:06 2005.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2005S/Outlines/outline.10.html.
You may wish to
validate this document's HTML
;
;
Check with Bobby