Skip to main content



      Home
Home » Newcomers » Newcomers » Using methods in Java that aren't in the class
Using methods in Java that aren't in the class [message #689597] Mon, 27 June 2011 19:52 Go to next message
Eclipse UserFriend
Hello everyone. This may seem like a noob question, but basically in my 'Workspace' I keep all my related assignments for school. They each have their own project, and are usually just one class. For many assignments I need to re-use exact methods that I have written in the past, and it's becoming a pain to hunt down each method I need before I can begin my newest assignment. I was wondering if there is any way I can just call methods and the compiler will go to the default package to find them? Thanks.
Re: Using methods in Java that aren't in the class [message #689610 is a reply to message #689597] Mon, 27 June 2011 21:19 Go to previous messageGo to next message
Eclipse UserFriend
On 06/27/2011 06:52 PM, forums-noreply@eclipse.org wrote:
> Hello everyone. This may seem like a noob question, but basically in my
> 'Workspace' I keep all my related assignments for school. They each have
> their own project, and are usually just one class. For many assignments
> I need to re-use exact methods that I have written in the past, and it's
> becoming a pain to hunt down each method I need before I can begin my
> newest assignment. I was wondering if there is any way I can just call
> methods and the compiler will go to the default package to find them?
> Thanks.
No there isn't a way to do this. In Java, all methods are contained
within classes. You need to have an instance of the class to call its
associated methods or the class name to invoke a static method.
Re: Using methods in Java that aren't in the class [message #689616 is a reply to message #689610] Mon, 27 June 2011 21:46 Go to previous message
Eclipse UserFriend
Okay thanks
Previous Topic:Creating all jars for export
Next Topic:Bash syntax coloring - Indigo
Goto Forum:
  


Current Time: Wed Jul 23 06:36:01 EDT 2025

Powered by FUDForum. Page generated in 0.07973 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top