2
It is possible to perform the class instance in PHP "in the same way" CachorroAbstract
in the method main
down 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();
}
}
Use interface :)
– user28595
Hello diegofm, thank you for the reply. In fact my php class has some implemented methods, I did this in java to be very brief, and these implemented methods make use of the returns of the methods.
– Ericks Rodrigues