The signature of the method defines which one will be invoked.
The signature of your 2 show methods are different. The first does not take any argument, the second takes an int argument.
As the argument is to be provided when invoking the method, the method to invoke has been defined.
More Related Contents:
- Attempt to invoke interface method ‘int java.util.List.size()’ on a null object How Solve It? [duplicate]
- Why can’t I define a static method in a Java interface?
- When to use: Java 8+ interface default method, vs. abstract method
- Java – Method name collision in interface implementation
- Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?
- Why java classes do not inherit annotations from implemented interfaces?
- When to use abstract class or interface? [closed]
- How to implement enum with generics?
- Can we create an instance of an interface in Java? [duplicate]
- Interface naming in Java [closed]
- How do Java Interfaces simulate multiple inheritance?
- How to make a Java class that implements one interface with two generic types?
- What does it mean to program to an interface?
- How to use interface to communicate between two activities
- What is the “default” implementation of method defined in an Interface?
- Why does it compile when casting to an unrelated interface? [duplicate]
- not implementing all of the methods of interface. is it possible?
- Java getting an error for implementing interface method with weaker access
- Why are all fields in an interface implicitly static and final?
- Java Reflection: Create an implementing class
- How to write junit tests for interfaces?
- Optional Methods in Java Interface
- Implementing two interfaces with two default methods of the same signature in Java 8
- Abstract Method Error
- Passing function as a parameter in java
- Meaning of “Cannot reduce the visibility of the inherited method” with an interface
- Java Interface Usage Guidelines — Are getters and setters in an interface bad?
- This appears to create an object from an interface; how does it work?
- Attributes / member variables in interfaces?
- How to reference a generic return type with multiple bounds