Re: can't import class in default package???
From: Dale King (kingd_at_tmicha.net)
Date: 12/18/03
- Previous message: Hugo Villeneuve: "Dream Tool for javadoc."
- In reply to: Y2KYZFR1: "Re: can't import class in default package???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Dec 2003 18:11:52 -0500
"Y2KYZFR1" <jarrodhroberson@yahoo.com> wrote in message
news:c718a6cf.0312170727.6b54de7c@posting.google.com...
> "Kay" <kangkang@interchange.ubc.ca> wrote in message
news:<br94i2$7j$1@nntp.itservices.ubc.ca>...
> > Hi:
> >
> > I have a java fiile that resides at the default package under src
folder. In
> > the same project, when I want to import that class, I just need to type
> >
> > import ClassName
> >
> > right? However, eclipse cannot resolve it. But I can see the class in
the
> > automatic code completion pop up list if I just type the first 1 or 2
letter
> > of the ClassName.
> >
> > So what should I do to import such class?
>
> you don't import things from the default package, that is why it is
> called the default package everything is already imported by default
Wrong on two counts. First it isn't called the default package. It is called
the unnamed package. And nothing from the unnamed package is imported by
default. They are visible to other members of the unnamed package since they
are in the same package, but they are not visible to compilation units in
other packages.
-- Dale King
- Previous message: Hugo Villeneuve: "Dream Tool for javadoc."
- In reply to: Y2KYZFR1: "Re: can't import class in default package???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|