+ 1
js
class Machine { public void start() { System.out.println("Starting..."); } } class Program { public static void main (String[] args) { Machine m1 = new Machine() { @Override public void start () { System.out.println("woooo"); } }; Machine m2 = new Machine (); m2.start(); } } how to come this code op?
1 Answer
+ 4
It is Java code, please edit your question - remove C++ from Relevant Tags and put Java in instead. And change your question - "js" does not describe your question clearly.
Good luck!