accessing a method within another class

i wish to access a public method in another class being new to java this is confusing can any one explain in i a simple way
[130 byte] By [newtoojavaa] at [2007-11-26 14:53:25]
# 1
I think the best way to do this is to implement an interface..
JustLilla at 2007-7-8 8:41:45 > top of Java-index,Java Essentials,Java Programming...
# 2

If it's a static method, call it like this:Abc.def()

where Abc is the name of the class and def is the name of the method.

If it's an instance method, then call it like this:abc.def()

where abc is a reference to an instance of the class and def is the name of the method. This isn't the New to Java forum or I would go on to tell you how to create an instance of a class, but I'll assume for now that you know that.

DrClapa at 2007-7-8 8:41:45 > top of Java-index,Java Essentials,Java Programming...
# 3
Read this: [url http://java.sun.com/docs/books/tutorial/]Sun Java tutorial[/url]Regards
jfbrierea at 2007-7-8 8:41:45 > top of Java-index,Java Essentials,Java Programming...
# 4
If the method you wish to call is a static method then use the classname,and if it is non-static then first create an instance of the class and then invokethe method on that instance.regards.
PMJaina at 2007-7-8 8:41:45 > top of Java-index,Java Essentials,Java Programming...