Download presentation
Presentation is loading. Please wait.
1
Day 11 The Last Week!
2
Review Data types: Java supplied: Color, String, int, double, boolean
Programmer created: Day, Rectangle, Car, Picture
3
Review: Object Oriented Programming
Instantiate objects: (example) Car mazda = new Car(25); Methods: use the dot operator on an object to call a method Signature: Public (sometimes private), return type, name, parameter in parenthesis: public void drive(double distance) Accessors: int currentYear=day1.getYear(); Mutators: rectangle1.translate(5,10); (Note: the return type is void) Constructors: No return type & requires new operator, see example above
4
Review--Variables Parameters: Passed into methods and are in the parentheses. Instance variable: private, at the top of a class Local variables: used in a method to make a calculation. Declare once by stating type Scope
5
Review--Design Pseudocode helps to create algorithms: calculation, repetition, decision Designing classes: Documentation helps to read others’ classes Create a plan for the methods, their signatures (1st lines) and the instance variables Test the classes directly through BlueJ or write a TesterClass with a main method
6
Review Loops Initialize, increment & test While loop For loop
7
Review--decisions if, if – else, if - else if - else
Relational operators Logical operators
8
Social Network Person Class
9
Nim Game
10
Rock, Paper, Scissors
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.