means this variable will not be accessible outside this class right? The Private part I mean...
public Dog(String name) {
this.name = name;
}This is the Method, I get that...
Where dose "this" come from?
When called it will basically say
name = Fido; ?
I mean once the variable is filled it will be Fido?
So what about this?
cobi.bark();
dog2.bark();
Or when dog2.bark(); is called is that where Fido is assigned? What about cobi.bark();? I am so confused over this little blurb of code. /me slams head into sharp pencil.
public String getName() {
return name;
}gets the name abviously, but "return name;" what dose this do? Same as print or println? Or maybe pass it on?
public void bark() {
System.out.println("woof!");
}Obviously prints out "woof!" but what about the rest of the properties of the dog like the name.
I know I am looking really retarded right now. But I swear it will click here soon. I downloaded the book and am reading it now. Thanks