 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Constructor method Special method with
|
|
the
same name as the class that is used
|
|
|
with
new when a class is instantiated
|
|
|
public Name(String frst, String lst)
|
|
|
{
|
|
|
first = frst;
|
|
|
last = lst;
|
|
|
}
|
|
|
Name name;
|
|
|
name = new Name(“John”, “Dewey”);
|
|
|
Note: argument cannot
be the same as field
|
|