sjm.examples.cloning
Class Course
java.lang.Object
|
+--sjm.examples.cloning.Course
- public class Course
- extends java.lang.Object
- implements PubliclyCloneable
This class shows a typical clone() method.
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
professor
protected Professor professor
textbook
protected Textbook textbook
Course
public Course()
clone
public java.lang.Object clone()
- Return a copy of this object.
- Specified by:
- clone in interface PubliclyCloneable
- Overrides:
- clone in class java.lang.Object
- Returns:
- a copy of this object
getProfessor
public Professor getProfessor()
- Get the professor.
- Returns:
- the professor
getTextbook
public Textbook getTextbook()
- Get the textbook.
- Returns:
- the textbook
setProfessor
public void setProfessor(Professor professor)
- Set the professor.
- Parameters:
Professor - professor
setTextbook
public void setTextbook(Textbook textbook)
- Set the textbook.
- Parameters:
Textbook - textbook