i cant create a Dog object, i should be able to i dont understand the compiling error, non-static variable this cannot be referenced from a static context
public class Program
{
abstract class Animal{
private String name;
String latin;
}
abstract class Carnivore extends Animal{}
abstract class Herbivore extends Animal{}
interface Petable{
public void pet();
}
class Dog extends Carnivore implements Petable{
public void pet(){System.out.println("bark");}
}
public static void main(String[] args) {
Dog d = new Dog();
d.pet();
}
}