| Author |
java.lang.NoSuchMethodError
|
Siva kandasamy
Ranch Hand
Joined: Dec 31, 2002
Posts: 139
|
|
Hi there, I have a simple code, causing run time exception, not sure why ? Placed below, is the source code and error message: Error Message: ============= % javac Shapes.java % java Shapes Exception in thread "main" java.lang.NoSuchMethodError: Shape: method <init>()V not found at Square.<init>(Shapes.java:4) at Shapes.main(Shapes.java:9)
|
 |
Rocky Summers
Ranch Hand
Joined: Nov 07, 2003
Posts: 66
|
|
you need to put a default constructor for your Shapes.java
|
 |
Rocky Summers
Ranch Hand
Joined: Nov 07, 2003
Posts: 66
|
|
|
oh yeah, you need to name your class the same name as your file. eg: Shape.java, you MUST name your class Shape...
|
 |
Siva kandasamy
Ranch Hand
Joined: Dec 31, 2002
Posts: 139
|
|
Thanks to you all. I figured out, this is due to the collision. Now it works fine. thanks siva
|
 |
 |
|
|
subject: java.lang.NoSuchMethodError
|
|
|