Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to import the class that is present in default package
how to import the class that is present in default package [message #324002] Wed, 16 January 2008 06:23 Go to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

I have created a class("xyz.java") in default package and i have made one more package(hello.abc) and created a class inside that package(new.java) i want to import the class that is in the default package in new.java how can i do that.is it possible or i have to create a package and put that file(xyz.java) to package
Re: how to import the class that is present in default package [message #324011 is a reply to message #324002] Wed, 16 January 2008 11:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

It is not possible to import things from the default package. Don't use
the default package. It's a useless thing.

gudsy wrote:
> I have created a class("xyz.java") in default package and i have made one more package(hello.abc) and created a class inside that package(new.java) i want to import the class that is in the default package in new.java how can i do that.is it possible or i have to create a package and put that file(xyz.java) to package
>
Re: how to import the class that is present in default package [message #324012 is a reply to message #324002] Wed, 16 January 2008 13:34 Go to previous messageGo to next message
Henning Vitting is currently offline Henning VittingFriend
Messages: 11
Registered: July 2009
Junior Member
Hi Gudsy!
You can drag a Java file between packages in the Project Explorer view.
Eclipse will insert the correct package statement for you.
Happy programming.
Henning

"gudsy" <automatic@javalobby.org> wrote in message
news:33014078.15111200464660178.JavaMail.root@cp1.dzone.com...
>I have created a class("xyz.java") in default package and i have made one
>more package(hello.abc) and created a class inside that package(new.java)
>i want to import the class that is in the default package in new.java how
>can i do that.is it possible or i have to create a package and put that
>file(xyz.java) to package
Re: how to import the class that is present in default package [message #324015 is a reply to message #324011] Wed, 16 January 2008 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Well it's not useless, just very limited :-) .

If you are doing a "one-off I just need to run this little thing right
now and I'm not talking to anybody else and they aren't talking to me
and I'm not putting it into a jar to run later in a fancy application"
then the default package is OK. Notice all of the qualifiers in the
above statement. :-)

Ed Merks wrote:
> It is not possible to import things from the default package. Don't use
> the default package. It's a useless thing.
>>

--
Thanks,
Rich Kulp
Previous Topic:Copy/paste to external application on Linux
Next Topic:Eclipse 3.3 - Open resource dialog + derived directories
Goto Forum:
  


Current Time: Mon Dec 30 16:32:25 GMT 2024

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

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

Back to the top