| Author |
static method overloading
|
Anvi Dixit
Ranch Hand
Joined: Aug 28, 2006
Posts: 45
|
|
Hi all, First have a look on the code given below: While running the code i am getting an Exception 'Exception in thread "main" java.lang.NoClassDefFoundError: Main/java Please explain me why this exception is coming. Thanks Anvi [ October 04, 2006: Message edited by: Barry Gaunt ]
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
You've got more mains in there than a pride of lions. Show us the java command you are using to run the program. Which program are you running. I think you're running the wrong program. Cheers! -Cameron www.pulpjava.com
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
Manu Dhanda
Greenhorn
Joined: Jan 28, 2006
Posts: 23
|
|
There is nothing wrong with this program. It will print: parent parent Anvi You must be making some mistake in calling it.
|
"Books are as useful to a stupid person <br />As a mirror is useful to a blind person." <br /> <br />Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)
|
 |
Anvi Dixit
Ranch Hand
Joined: Aug 28, 2006
Posts: 45
|
|
Thanks Manu and Kameron i made the mistake by naming the method as Main and Main1..when i used different names for the methods i got the solution as parent parent Anvi Thanks Anvi
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
Originally posted by Manu Dhanda: There is nothing wrong with this program. It will print: parent parent Anvi You must be making some mistake in calling it.
That's correct. Anvi, are you typing the command as "java Main.java" instead of just "java Main"? [ October 04, 2006: Message edited by: Barry Gaunt ]
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: static method overloading
|
|
|