Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 23:52 Go to next message
descartes.holland is currently offline descartes.hollandFriend
Messages: 6
Registered: June 2011
Junior Member
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] Tue, 28 June 2011 01:19 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
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] Tue, 28 June 2011 01:46 Go to previous message
descartes.holland is currently offline descartes.hollandFriend
Messages: 6
Registered: June 2011
Junior Member
Okay thanks
Previous Topic:Creating all jars for export
Next Topic:Bash syntax coloring - Indigo
Goto Forum:
  


Current Time: Thu Apr 25 16:11:45 GMT 2024

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

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

Back to the top