模拟发红包
- 结构分析
代码
- User类
1 | public class User { |
- Manager类
1 | public class Manager extends User { |
- Member类
1 | public class Member extends User { |
- 主类
1 | public static void main(String[] args) { |
- 运行结果
1 | 我叫:hxx剩余金额:96.9 |
1 | public class User { |
1 | public class Manager extends User { |
1 | public class Member extends User { |
1 | public static void main(String[] args) { |
1 | 我叫:hxx剩余金额:96.9 |