- 1
Say that I'm wrong, but I'm sure you can instanciate abstract classes
You just need to define the abstract methods while instanciating: abstract class A { absract void print(String val); } public static void main(String[] args) { A obj = new A(){ print(String val) { System.out.println(val); } }; }
1 Antwort
+ 1
Well, its nothing new... They are called anonymous classes and you can use with concrete/abstract classes and interfaces