Java
private String name
public Guest (){
name=null;
}}`
`
public Guest(String NAME1){
if (Name==null){
NAME1="Set a name";
}
}`
Get and set method here
toString here.
There is one class for Guest and a class for Address. The code almost looks the same except the String is called something else on Address.
public Guest(String NAME1){
this part how can use that part or "call it " to use in a another class.
A someObject = new A("whatever", "something", "foo");
- – OH GOD SPIDERSA a= new A();
thena.getSomething
. That works or a.toString. But i can't do that when trying to use thepublic A(String a,String B, String C){ code here }
. A and B are almost the same but are differant kind of Strings. So I have to "call" the code from A to B. So call "A" toString and get. I don't know if that helps but its really hard to explain it. – Alex Benjamin