I’m studing on a project. It’s a bank simulation and just for practicing OOP metodologies.
Here is my code, could you help me about OOD. How can I use inheritance and interfaces on this project?
public class Main {
public static void main(String[] args) {
User[] User = new User[10];
for(int i = 0; i < 10; i++)
User[i] = new User(i);
System.out.print("User Number:");
Scanner s = new Scanner(System.in);
int UserNo = 0;
if(s.hasNextInt())
UserNo = Integer.parseInt(s.next());
public void withdraw()
public void payIn(){
public void MoneyOrder(){
}
You could put all your withdraw() etc other methods in an interface and create a concrete implementation of these methods..
And for inheritance you an categorize the users as privileged user or general user .You can further do categorization based on Account type as Current or Saving Account etc.
Banking Simulation is a Big Project and You must follow all the OOSE concepts like drawing Use Case Diagrams ,Class Diagrams Which would help you in identifying relationship between classes.
For e.g Users have Account.Thus there is an Association Relationship between the two classes.And depending upon your application you can select multiplicity(A user can have many Accounts).This means each of these classes would contain object references of each other.