M/F 2:30-3:20 |
CS 1130: Transition to OO Programming Spring 2016 |
Main
About: Overview Announcements Staff Consultants Calendar Materials: Texts DrJava Terminology Lectures: In-Class Web-Based VideoNote Assessment: Grading Assignments Labs Resources: CMS Piazza (link) Piazza (about) Java API Style Guide Academic Integrity |
Module 1, Part 6The Class DefinitionYou will see your first class definition and learn about subclasses and superclasses. You will also see definitions of methods —functions, procedures, and constructors— and variables, called fields, in a class definition. Contents1. The Class DefinitionWeb Lecture
Reading:
Lecture Notes
Comments:
See your first class definition, compile it, and then make it look just like a 2. Defining MethodsWeb Lecture
Reading:
Lecture Notes
(Lecture Slides) Comments: See how to draw an instance of a subclass, and learn how to define a function and a procedure.
Self-help Exercises:
These are important, do them all! 3. Declaring Fields and Getter/Setter MethodsWeb Lecture
Reading:
Lecture Notes Comments: See how to declare fields in a class. Usually, they are made private, so they cannot be referenced directly from outside the class. But getter/setter methods can be provided to allow access. 4. The Constructor and the new-ExpressionWeb Lecture
Reading:
Lecture Notes
(Lecture Slides) Comments: We need a simple way to initialize fields of a newly created object. The constructor, a new kind of method, is the vehicle for this. After describing the constructor, we visit the new-expression once again and show you how to execute it. 5. Function
Web Lecture
|