Java: Interface - wiem co to jest
W zasadzie, to wystarczy prześledzić to, co robi ten kod: import java.util.ArrayList ; import java.util.List ; public class Suma { private static List<X> tab = new ArrayList<>() ; public static void main (String[] args) { tab .add( new X1()) ; tab .add( new X2()) ; tab .add( new X3()) ; someMethod () ; } static void someMethod() { for (X x: tab ) { x.doSomething() ; x.yes() ; } } } public interface X { void doSomething () ; void yes () ; } public class X1 implements X { public void doSomething (){ System. out .println( "X1" ) ; } public void yes (){ System. out .println( "yes1" ) ; } public void no (){ System. out .println( "no1" ) ; } } public class X2 implements X { public void doSomething (){ System. out .println( "X2" ) ; } public void tak ...