0
votes

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.

"grab a constructor" is not a clear defined technical term. Can you maybe explain what you mean by "grab"?OH GOD SPIDERS
i edited the question. Basically use it in Class B so basically "grabbing it from A to use it in B" if that helps a littleAlex Benjamin
Use it in B to do what? Just create an Object of class A? In that case that you just need to import class A with an import statement in class B (Many IDEs are able to help organoze your imports in a class) and then use it normally like A someObject = new A("whatever", "something", "foo"); -OH GOD SPIDERS
@OHGODSPIDERS im just confused that i can do A a= new A(); then a.getSomething. That works or a.toString. But i can't do that when trying to use the public 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
I'm gonna be honest. I didn't understand much of what you just wrote. You should consider creating a MVCE to show your problem with actual code.OH GOD SPIDERS