Overriding whats going on here?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Overriding whats going on here??

Machine m = new Machine() { @Override public void start() { System.out.println("Wooooo"); } };<<HERE m.start(); << HERE } }

20th Jul 2017, 8:56 PM
D_Stark
D_Stark - avatar
1 Resposta
0
you are overriding the functions of the Machine class for the instance m m.start() is simply calling the start() function from the instance m
22nd Jul 2017, 4:28 PM
Kedar Kale
Kedar Kale - avatar