Globalo Esperanto ->
Saluton !
Mi havas probleman kun la sistemo. La sistemo havas kuriozan eraron, sed mi ne komprenas kial.
Bonvolu helpu min.
Local english ->
Hi !
I have a problem with the system. The system does have a curious error message, but I don't know why.
Please help me.
package com.codegym.task.task14.task1409;
//Bridges
//1. Create a Bridge interface with an int getCarsCount() method.
//2. Write WaterBridge and SuspensionBridge classes that implement the Bridge interface.
//3. The getCarsCount() method must return any constant int value.
//4. The getCarsCount() method must return different values for different classes.
//5. Create a public println(Bridge bridge) method in the Solution class.
//6. In the println method, display the result of calling getCarsCount() method on the bridge object.
//7. Each class and interface must be in separate files.
//Requirements:
//1. The Bridge interface must be in a separate file.
//2. The WaterBridge and SuspensionBridge classes must be in separate files.
//3. The WaterBridge and SuspensionBridge classes must implement the Bridge interface.
public class Solution {
public static void main(String[] args) {
println(new WaterBridge());
println(new SuspensionBridge());
}
// Add println method here
public static void println(Bridge bridge){
// WaterBridge waterBridge = new WaterBridge();
// SuspensionBridge suspensionBridge = new SuspensionBridge();
// System.out.println(waterBridge.getCarsCount());
// System.out.println(suspensionBridge.getCarsCount());
bridge.getCarsCount();
}
}