Basic Java Refresher
Short Description
Basic Java Refresher. A quick run-through of basic Java features and syntax in a single handout. Student Java Example. . As a first example of a java class, …
Website: www.stanford.edu | Filesize: 144kb
Content
CS108, Stanford
Winter, 2004-05 Nick Parlante
Basic Java Refresher
A quick run-through of basic Java features and syntax in a single handout
Student Java Example
?As a first example of a java class, we’ll look at a simple “Student” class. Each Student
object stores an integer number of units and responds to messages like getUnits() and
getStress(). The stress of a student is defined to be units * 10.
Implementation vs. Interface
?In OOP, every class has two sides…
?1. The implementation of the class — the data structures and code that implement its
features.
?2. The public interface that the class exposes for use by other classes.
?With a good OOP design, the interface is smaller and simpler than the implementation.
The public interface is as simple and logical as possible — exposing only aspects that
the clients care about.
?We’ll use the word ” client” to refer to code that uses the public interface of a class and
“implementation” when talking about the guts of a class.
Student Client Side
?First we’ll look at some client code of the Student class.
?Client code will typically allocate…
Get the file Download here
Related Books:Related Searches: nick parlante, word client, oop design, public interface, java features
Comments
Leave a Reply