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){
System.out.println(bridge.getCarsCount());
}
}
People, please explain what is the difference if i put/orNot a "public" accesor before printl(Bridge bridge) method?
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Alexandru Ovcinicov
6 October 2019, 20:27
thanks Guadalupe !
i've managed this Exercise.
The question arised from the thought that my Class is Public and then the main is public..
So , the answer is: PUBLIC for PUBLIC
0
Guadalupe Gagnon
6 October 2019, 16:07
It's an access modifier and you should read up on them if you are confused how they are used. Other than that the requirements for this task say that to be correct and pass you must:
5. Create a public println(Bridge bridge) method in the Solution class.
+1