title: Error: main method not found in class please define the main method as: public static void main(String[] args)
body: <p>I have written simple java code in notepad and trying to execute in command prompt.Getting  </p>
  
  <p>Error: Main method not found in class Box, please define the main method as:
     public static void main(String[] args)
  or a JavaFX application class must extend javafx.application.Application</p>
  
  <pre><code>class Box
  {
  int length,breadth,height;
  public void setDimension(int l,int b,int h)
  {
   length=l;
   breadth=b;
   height=h;
    }
   public void showDimension()
   {
  System.out.println("l=" + length);
  System.out.println("b=" + breadth);
   System.out.println("h=" + height);
    } }
  
   class example
   {
   public static void main(String[] args)
   {
     Box smallBox= new Box();
     smallBox.setDimension(21,12,1);
     smallBox.showDimension();
  }
  }
  </code></pre>