Static import with sefault package

Discussion in 'Java' started by Matteo, Oct 20, 2004.

  1. Matteo

    Matteo Guest

    I'm converting to Java1.5. I've implemented static import with no
    problem, with the exceptions of some statics in a class in the default
    (unnamed) package. When I try to static import this it gives me a
    "cannot find symbol" error on compilation.
    Why?
    How can I do?

    Thank you,
    Matteo
    Matteo, Oct 20, 2004
    #1
    1. Advertising

  2. Matteo wrote:

    > I'm converting to Java1.5. I've implemented static import with no
    > problem, with the exceptions of some statics in a class in the default
    > (unnamed) package. When I try to static import this it gives me a
    > "cannot find symbol" error on compilation.


    I'm not surprised.

    > Why?


    You can't generally import members of a default package since
    1.<mumble>. IIRC, Sun classifies it as a bug [now fixed] that you ever
    were able to do.

    > How can I do?


    Put your classes in a named package. This is good general advice in any
    case.


    John Bollinger
    John C. Bollinger, Oct 20, 2004
    #2
    1. Advertising

  3. Matteo

    Matteo Guest

    "John C. Bollinger" <> wrote in message news:<cl5p05$vd9$>...
    > Matteo wrote:
    >
    > > I'm converting to Java1.5. I've implemented static import with no
    > > problem, with the exceptions of some statics in a class in the default
    > > (unnamed) package. When I try to static import this it gives me a
    > > "cannot find symbol" error on compilation.

    >
    > I'm not surprised.
    >
    > > Why?

    >
    > You can't generally import members of a default package since
    > 1.<mumble>. IIRC, Sun classifies it as a bug [now fixed] that you ever
    > were able to do.
    >
    > > How can I do?

    >
    > Put your classes in a named package. This is good general advice in any
    > case.
    >


    I'll put all in a named package,
    Thank you!
    Matteo, Oct 21, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parvinder
    Replies:
    6
    Views:
    745
    Thomas G. Marshall
    Feb 27, 2005
  2. Paul Opal
    Replies:
    12
    Views:
    946
    Paul Opal
    Oct 11, 2004
  3. Dave
    Replies:
    2
    Views:
    467
  4. George P
    Replies:
    3
    Views:
    680
    Alex Martelli
    Sep 11, 2004
  5. Gabriel Rossetti
    Replies:
    1
    Views:
    496
    ryles
    Sep 20, 2009
Loading...

Share This Page