Java Program Error -


while learning book, came across java example. when compiled it, had no error. when ran , showed:

exception in thread "main" java.lang.nosuchmethoderror: main 

since beginner in java, don't know is.

the program is:


import java.awt.*; import java.awt.event.*;  class party { public void buildinvite(){     frame f = new frame();     label l = new label("party @ tim's");      button b = new button("you bet");     button c = new button("shoot me");     panel p = new panel();     p.add(l); } } 

if still want see execution of code try version:

class party{         public void buildinvite(){         frame f = new frame();         label l = new label("party @ tim's");         button b = new button("you bet");         button c = new button("shoot me");         panel p = new panel();         p.add(l);         p.add(b);         p.add(c);         f.add(p);         f.setvisible(true);         }          public static void main(string[] args) {             new party().buildinvite();         }     } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -