Animal is a user defined class here.
Animal D = new Animal("Leo") { @Override public void makeNoise() { System.out.println("Roar!"); }}; D.makeNoise();
Aucun commentaire:
Enregistrer un commentaire