Bridges

  • 8
  • Locked
Create a Bridge interface with a getCarsCount() method that counts cars. Write WaterBridge and SuspensionBridge classes that implement this interface. The getCarsCount() method must return any constant int value. This value must be different for different classes.
You can't complete this task, because you're not signed in.
Comments (4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Oege Hiddema Java Developer at CodeGorilla
12 July 2022, 16:16
Calling the variable 'waterBridge' is very confusing. Better call it 'bridge':
public static void println(Bridge waterBridge) {
    System.out.println(waterBridge.getCarsCount());
}
LennyMan
Level 25 , Lucca, Italy
28 December 2020, 12:08
Very nice task! I like that now we start to work with different file, it seems everything more... real ! :)
Payal Agarwal
Level 17 , Bucharest, Romania
16 August 2019, 16:52
How can I create a new file using ipad. I am unable to right click on the folder. Is this the issue with the editor??
Angel Li
Level 18 , Fremont, United States
5 July 2020, 00:16
If you are on ipad you have to use the two finger click method where you click the file with two fingers at the same time. Because Ipads are touchscreen it doesn't have the right click thing.