桥梁

  • 8
  • 已锁定
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.每个类和接口必须位于单独的文件中。
无法完成此任务,因为你尚未登录。
评论 (1)
  • 受欢迎
你必须先登录才能发表评论
levn
级别 19
26 五月 2020, 02:56
it said class SuspensionBridge is public, should be declared in a file named SuspensionBridge.java, 但是我已经设置了啊这是为什么