Re: can't import class in default package???

From: Dale King (kingd_at_tmicha.net)
Date: 12/18/03

  • Next message: Alexander Demenchuk: "[ANN] The Beaver Parser Generator v0.9.0"
    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
    

  • Next message: Alexander Demenchuk: "[ANN] The Beaver Parser Generator v0.9.0"

    Relevant Pages

    • Re: Can single classes be imported (without using : import package)
      ... "Juergen Kluth" wrote: "package package-name" ... Owen Jacobson wrote: ... Per the Java language specification: "It is a compile time error to ... it is in the unnamed package. ...
      (comp.lang.java.programmer)
    • Re: Can single classes be imported (without using : import package)
      ... if i have a useful class in a seperate file, which java code has NO line of ... import a type from the unnamed package." ... it is in the unnamed package. ...
      (comp.lang.java.programmer)
    • Re: Music stops playing in PowerPoint 2003 slideshow
      ... slideshow. ... The linked music files are included in the package. ... copy any presentation to the folder, make the name change in the playlst ... I changed the effect options to "Stop playing after 999 slides," ...
      (microsoft.public.powerpoint)
    • Re: Lost !
      ... User Overrides for BDSCOMMONDIR and BDSUSERDIR ... and .dcp went into my folders, while the .dcu went into the folder of the package source. ... A source code file for a Delphi unit. ...
      (comp.lang.pascal.delphi.misc)
    • RE: OSD - Network Access Account Issue
      ... I did check the package folder permissions and went to so far as to add the ... in either the boot-CD or the package reference on the boot-CD. ... that account always had permissions to ...
      (microsoft.public.sms.admin)