class Manager{ Manager(){ System.out.println("Manager"); } } public class ATM{ static Manager m; ATM(){ m = new Manager(); System.out.println("ATM"); } public static void main (String[] args) { //Customer cus = new Customer(); new ATM(); new ATM(); new ATM(); } }
package bank; public class Customer{ String account; private double balance = 0; Customer(){} }
package bank.sys; import bank.Customer;//导入 public class ATM{ public static void main (String[] args) { Customer cus = new Customer(); } }
package bank; class Customer{ String account; protected String cname; private double balance; public void quKuan(){} public void cunKuan(){} }
原文:https://www.cnblogs.com/pblqjyg/p/10713468.html