ERROR: No enclosing instance of type OOPTutorial is accessible
<p>I am new to Java and trying to do a simple program to help me further understand object-orientated programming.</p>

<p>I decided to do a phone program. However on line 5 of the following program where I'm trying to create an instance of a phone class I am getting the following error: </p>

<p>"No enclosing instance of type OOPTutorial is accessible. Must qualify the allocation with an enclosing instance of type OOPTutorial (e.g. <code>x.new A()</code> where <code>x</code> is an instance of <code>OOPTutorial</code>)."</p>

<p>Here is the program: </p>

<pre><code>public class OOPTutorial {

    public static void main (String[] args){

        phone myMobile = new phone();           // &lt;-- here's the error
        myMobile.powerOn();
        myMobile.inputNumber(353851234);
        myMobile.dial();

   }

   public class phone{
       boolean poweredOn = false;
       int currentDialingNumber;

       void powerOn(){
           poweredOn = true;
           System.out.println("Hello");
       }
       void powerOff(){
           poweredOn = false;
       System.out.println("Goodbye");
       }
       void inputNumber(int num){
       currentDialingNumber = num;
       }
       void dial(){
           System.out.print("Dialing: " + currentDialingNumber);
       }
   }
}
</code></pre>
