help please

Discussion in 'Java' started by maitreya, Nov 5, 2006.

  1. maitreya

    maitreya Guest

    hello im new to this group as im to java. i wanted to clarify this
    situation ->

    we have a package called A and we have imported it in a class of
    package C
    now, will all the subclasses of all the classes of package A (may
    they be in package A or in any other package) be available to the
    importing class of package C.

    also tell of a way to importing the if they dont get imported.

    kindly respond
    maitreya, Nov 5, 2006
    #1
    1. Advertising

  2. maitreya wrote:
    > hello im new to this group as im to java. i wanted to clarify this
    > situation ->
    >
    > we have a package called A and we have imported it in a class of
    > package C
    > now, will all the subclasses of all the classes of package A (may
    > they be in package A or in any other package) be available to the
    > importing class of package C.
    >
    > also tell of a way to importing the if they dont get imported.


    Java import does not affect if a class is available (*)
    it is just a compile time convenience feature.

    (*) a 3rd party library (jar) needs to be put in the classpath for the
    classes it contains to be available.


    You don't have to use import - you can write out the path explicitly in
    your source code.


    java.text.DecimalFormat fmt = new java.text.DecimalFormat("0.0");


    When compiled, the bytecode this produces will be indistinguishable from
    the bytecode produced for


    import java.text.DecimalFormat;

    DecimalFormat fmt = new DecimalFormat("0.0");
    Thomas Schodt, Nov 5, 2006
    #2
    1. Advertising

  3. maitreya

    Simon Brooke Guest

    in message <>, maitreya
    ('') wrote:

    > hello im new to this group as im to java. i wanted to clarify this
    > situation ->
    >
    > we have a package called A and we have imported it in a class of
    > package C
    > now, will all the subclasses of all the classes of package A (may
    > they be in package A or in any other package) be available to the
    > importing class of package C.


    No.

    > also tell of a way to importing the if they dont get imported.


    Import them explicitly.

    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/

    ;; If you're doing this for fun, do what seems fun. If you're
    ;; doing it for money, stop now.
    ;; Rainer Deyke
    Simon Brooke, Nov 5, 2006
    #3
  4. maitreya

    maitreya Guest

    Simon Brooke wrote:
    > in message <>, maitreya
    > ('') wrote:
    >
    > > hello im new to this group as im to java. i wanted to clarify this
    > > situation ->
    > >
    > > we have a package called A and we have imported it in a class of
    > > package C
    > > now, will all the subclasses of all the classes of package A (may
    > > they be in package A or in any other package) be available to the
    > > importing class of package C.

    >
    > No.
    >
    > > also tell of a way to importing the if they dont get imported.

    >
    > Import them explicitly.
    >
    > --


    thanks

    > (Simon Brooke) http://www.jasmine.org.uk/~simon/
    >
    > ;; If you're doing this for fun, do what seems fun. If you're
    > ;; doing it for money, stop now.
    > ;; Rainer Deyke


    many thanks
    maitreya, Nov 5, 2006
    #4
    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. JC
    Replies:
    4
    Views:
    7,947
    Jeff C
    Jul 8, 2004
  2. Replies:
    4
    Views:
    490
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    516
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,716
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,078
Loading...

Share This Page