I had the following error:
Non-static variable this can not be referenced from a static context
This is the code
cellphone dg = new Cellphone()
public class Oops7 {
class Cellphone {
void ring() {
System.out.println("Your phon is ringing");
}
void sing() {
System.out.println("Your phon is singing");
}
void vibrate() {
System.out.println("Your phon is vibrating");
}
}
public static void main(String[] args) {
Cellphone dg = new Cellphone();
dg.vibrate();
dg.sing();
dg.ring();
}
}