Object oriented
Objects and classes
Staff Category: Staff a staff B ....
Relationships between classes
Association Relationship: Association Relationship (weak)
Inheritance relationship: xx is a kind of xx (tree)
Athletes
Ball Players
Football player
Aggregation relationship: XX is part of XX (Whole and part)
Gather team = Captain + player
Combination person = Body +head
To implement a relationship:
Pet Care <<interface>>
Polymorphic:
Print
Java and object-oriented
Everything is Object
Object = member Variable + method
Class is a template
Dog.java
public class dog{
int furcolor;
float height;
float weight;
void Catmouse (Mouse m) {
M.scream ();
}
}
Definition of Java class
Member variables
Reference type new object performance in memory code seg heap SEG Stack
Construction method
Class name () {}
Use with new
Overriding construction methods
Customary naming conventions
Class name first Letter capital
Variable method first Letter lowercase
Hump marking
Memory analysis
Test. Java class birthdate{}
Testpoint.java
Stack Memory---> Heap memory
J2SE Base-3