A Summary of Classes in Java.

Essay by lovenlifHigh School, 12th grade November 2003

download word file, 2 pages 3.9

Downloaded 108 times

My Quick Summary of Classes

1.A class is an abstract concept.

a.Other Descriptions

i.A class is a blueprint.

ii.A class represents a category of items.

b.Examples

i.A Radio is a category of items.

ii.A Student is a category of items.

iii.A Ball is a category of items.

2.An object is the embodiment of a class.

a.Other Descriptions

i.An object is an instance of a class.

ii.An object is an actual item. It exists.

b.Examples

i.The radio in your room is an object of the Radio class. It exists.

ii.You are an object of the Student class.

iii.The ball the basketball team uses in an object of the Ball class.

3.A class consists of two basic things:

a.Instance Data (the NOUNS)

i.Other Descriptions

1. Instance data represents the state of an object.

2.Instance data represents the attributes of an object.

3.Instance data represents the characteristics of an object.

ii.Examples

1.A volume dial and tuner are attributes of a Radio.

2.A name and GPA are attributes of a Student.

3.Size and color are the attributes of a Ball.

iii.Visibility of Instance Data

1.Instance Data represents private information.

2.Clients should not be able to modify private information.

3.Variables should be private.

4.Constants can be either public or private. (Why?)

b.Methods (the VERBS)

i.Other Descriptions

1.Methods represent the behavior or an object.

2.Methods represent the services an object can provide.

3.Methods represent the things an object can do.

ii.Examples

1.A Radio can change volume. A Radio can change the station.

2.A Student can tell you his/her GPA.

3. A Ball can bounce. A Ball...