NoClassDefFoundException 1 Answer(s) 3 years and 4 months ago
Posted in : Java Beginners
following code has compiled sucessfully but at run time it givs error "NoClassDefFoundException". no other erorr
import java.awt.*; import java. awt.event.*;
public class marks extends Frame implements ActionListener { Label l= new Label("enter the roll"); Label l1= new Label("enter the name"); Label l2= new Label("enter the marks"); TextField t= new TextField(10); TextField t1= new TextField(10); TextField t2= new TextField(10); TextField t3= new TextField(10); Button b= new Button("Result"); Button b1= new Button("Exit");
public void actionPerformed(ActionEvent e) { if(e.getSource()==b) { int n = Integer.parseInt(t2.getText()); if(n>=60) { t3.setText("Pass"); } else { t3.setText("Fail"); } } if(e.getSource()==b1) { System.exit(0); } } public static void main(String args[]) { marks m = new marks("my Frame"); m.setSize(300,300); m.setVisible(true); } }
View Answers
January 22, 2010 at 2:49 PM
Hi Friend,
It seems that you haven't saved your class with marks.java.Therefore you have got this error.
Thanks
Related Pages:
NoClassDefFoundException - Java Beginners
NoClassDefFoundException following code has compiled sucessfully but at run time it givs error "NoClassDefFoundException". no other erorr
import java.awt.*;
import java. awt.event.*;
public class marks extends Frame