Create a class called Bank. In this class have a method called createAccount which accepts a string and returns an object of type account. Register the bank object with the naming service and get a reference to it from your client app. Call the createAccount() method to return the class you require:
public class Bank{
public Bank(){
}
public Account createAccount(String name) {
Account myAcc = new Account(name);
myAcc.connect();
return myAcc;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.