class Account01{ String name; String sfz; String Phone; double balance; public double z1(double money){ balance=balance-100; return balance; } } class Account02{ String name; String sfz; String Phone; double balance; public double z2(double money){ balance=balance+100; return balance; } } class Client01{ String name; double balance; String phone; } public class Employee02 { public static void main(String[] args) { Account01 a1=new Account01(); a1.name="小明"; a1.Phone="1234568"; a1.sfz="43122"; a1.balance=200.0; System.out.println("小明的余额:"+a1.balance); Account02 a2=new Account02(); a2.name="小红"; a2.Phone="321312"; a2.sfz="13445"; a2.balance=200.0; System.out.println("小红的余额:"+a2.balance); System.out.println("转账后:"); double money=100; System.out.println("小明还剩"+a1.z1(100)); System.out.println("小红还剩"+a2.z2(100)); } }
实现两个账户转账
最新推荐文章于 2022-09-22 23:47:47 发布