title: Making my own custom class why it gave me an error
body: <p>I had the following error:</p>
  <blockquote>
  <p>Non-static variable this can not be referenced from a static context</p>
  </blockquote>
  <p>This is the code</p>
  <pre class="lang-java prettyprint-override"><code>cellphone dg = new Cellphone()
  
  public class Oops7 {
      class Cellphone {
          void ring() {
              System.out.println(&quot;Your phon is ringing&quot;);
          }
  
          void sing() {
              System.out.println(&quot;Your phon is singing&quot;);
          }
  
          void vibrate() {
              System.out.println(&quot;Your phon is vibrating&quot;);
          }
      }
  
      public static void main(String[] args) {
          Cellphone dg = new Cellphone();
          dg.vibrate();
          dg.sing();
          dg.ring();
      }
  }
  </code></pre>