File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes java.lang.NoSuchMethodError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.lang.NoSuchMethodError" Watch "java.lang.NoSuchMethodError" New topic
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
 
jQuery in Action, 2nd edition
 
subject: java.lang.NoSuchMethodError
 
Similar Threads
Polymorphic method declarations
Generics doubt
Methods and Generics
the instance variable shapes
Please Help?