Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
This is my first java program, and while compiling it is not throwing any error. But while executing it, I am getting NoClassDefFoundError. Below is my code:

Java
class Myclass 
{
	static int x=10;
	static int y=20;

	public static void main(String[] args) 
	{
		
		display();
		System.out.println("Value of static variable x= "+x);
		System.out.println("Value of static variable y= "+y);
	}

	static void display()
	{
		System.out.println("This is a display method");
	}

}



Can someone plese look into it??
Thanks
Posted
Updated 6-Jul-15 4:54am
v2
Comments
TorstenH. 6-Jul-15 10:55am    
I added the the foramt to the code.

looks fine to me. Should work.


How did you write it? Did you use an IDE?
Richard MacCutchan 6-Jul-15 11:36am    
Chances are you mistyped the class name. Show the actual java command that you typed, and the exact text of the error message.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900