It is possible to do in PHP "in the same way" the instance of class CachorroAbstract
in method main
below:
public abstract class CachorroAbstract {
public abstract void latir();
}
public class Main{
public static void main(String[] args) {
CachorroAbstract cachorro = new CachorroAbstract() { //AQUI
@Override
public void latir() {
System.out.println("AU! AU!");
}
};
cachorro.latir();
}
}