I have found some difficult cautious between Java 1.7_51 and Java 1.8_20.
The initial situation:
One Interface:
interface InterfaceA {
public void doSomething();
}
Two classes:
public class ClassA implements InterfaceA {
public void doSomething() {
System.out.println("Hello World!");
}
}
public class ClassB {
public static void main(String[] args) {
ClassA a = new ClassA();
a.doSomething();
}
}
Next i have compiled the classes with (Java 1.8) -> javac *.java after the compiler finished i removed the InterfaceA.java and InterfaceA.class file's. Now i try again too compile only the ClassB.java and got the error message:
ClassB.java:4: error: cannot access InterfaceA a.doSomething();
class file for InterfaceA not found 1 error
The same i have tried with java 1.7.. -> javac *.java after the compiler finished i removed the InterfaceA.java and InterfaceA.class file's. But know i got no error message ..
Can someone explain me this?
.. sorry for my bad english ..