Java Basic Refresher
Short Description
Java Basic Refresher. A quick run-through of basic Java features and syntax in a single handout for CS108 and any. other purpose. …
Website: www.stanford.edu | Filesize: 228kb
Content
Java Basic Refresher
A quick run-through of basic Java features and syntax in a single handout for CS108 and any
other purpose. The source code of this example is available in the hw directory as
“StudentExample” — Nick Parlante
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 Style
?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.
?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.
?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 and keeping the…
Get the file Download here
Related Books:Related Searches: nick parlante, interface style, oop design, public interface, purpose website
Comments
Leave a Reply