title: class can't be instantiated
body: <p>I have a problem with java applet and graphics. I'm trying to run it in Eclipse and it fails.
  Im new in java and i hope you can help me.
  I have two files: Say.java and SayWhat.java.
  Say.java:</p>
  
  <pre><code>public class Say {
      SayWhat word = new SayWhat("Hello World");
  
  }
  </code></pre>
  
  <p>SayWhat.java:</p>
  
  <pre><code>import java.applet.Applet;
  import java.awt.Graphics;
  
  @SuppressWarnings("serial")
  public class SayWhat extends Applet {
       Graphics g;
       String what;
      public SayWhat(String what) {
          this.what=what;
      }
      public void paint(Graphics g){
          g.drawString(what, 20, 20);
      }
  }
  </code></pre>
  
  <p>Error that appears is:</p>
  
  <pre><code>load: SayWhat.class can't be instantiated.
  java.lang.InstantiationException: SayWhat
      at java.lang.Class.newInstance0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at sun.applet.AppletPanel.createApplet(Unknown Source)
      at sun.applet.AppletPanel.runLoader(Unknown Source)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Can you please tell me what am i doing wrong?</p>