I got a compiler error on HPrinter class saying to include unimplemented methods or make my class abstract, what is obviously correct, but what I don't understand is why does java allows to create an object of that class, I know it is not explicitly abstract but it is implicitly. I know I don't call the unimplemented method, if I do it so I would got an error, but in first place it shouldn't let you create an object of HPrinter class, doesn't it? Here is an example:
public interface Printer {
void print();
void scan();
}
public class HPrinter implements Printer {
public void print() {
System.out.println("print()");
}
}
public class TestInterface {
public static void main(String[] args) {
Printer p=new HPrinter();
p.print();
}
}