1.创建包含 int getCarsCount() 方法的 Bridge 接口。
2.编写实现 Bridge 接口的 WaterBridge 和 SuspensionBridge 类。
3.getCarsCount() 方法必须返回任何 constant int 值。
4.getCarsCount() 方法必须返回不同类的不同值。
5.在 Solution 类中创建 public println(Bridge bridge) 方法。
6.在 println 方法,显示在 bridge 对象上调用 getCarsCount() 方法的结果。
7.每个类和接口必须位于单独的文件中。
桥梁
- 8
已锁定
评论 (1)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
levn
26 五月 2020, 02:56
it said class SuspensionBridge is public, should be declared in a file named SuspensionBridge.java, 但是我已经设置了啊这是为什么
0