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
Thomas Schodt - 05 Nov 2006 09:48 GMT
> hello im new to this group as im to java. i wanted to clarify this
> situation ->
[quoted text clipped - 6 lines]
>
> 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");
Simon Brooke - 05 Nov 2006 11:49 GMT
> hello im new to this group as im to java. i wanted to clarify this
> situation ->
[quoted text clipped - 4 lines]
> 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.

Signature
simon@jasmine.org.uk (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
maitreya - 05 Nov 2006 14:44 GMT
> > hello im new to this group as im to java. i wanted to clarify this
> > situation ->
[quoted text clipped - 12 lines]
>
> --
thanks
> simon@jasmine.org.uk (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