Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

about the import statement

Thread view: 
bubble601@gmail.com - 26 Jul 2007 10:35 GMT
i found the following kinds of import statement.

for example, if A.java want to import the class B.C.D. but it write
the import statement like this:

import  C.D;

which means B is omitted. the project is build by maven, does it
legal? why?
Andrew Thompson - 26 Jul 2007 11:51 GMT
>i found the following kinds of import statement.

Where?  Got an URL to this source*?

* (Or it's JavaDocs, build file..)

>for example, if A.java want to import the class B.C.D. but it write
>the import statement like this:
[quoted text clipped - 3 lines]
>which means B is omitted. the project is build by maven, does it
>legal? why?

Sounds like complete rot to me.  But then, I am not
confident that you are posting the correct details,
so (my suggestion is) try stopping using this 'A',
'B', 'C'.. rubbish and tell us the actual class/package
names involved.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Roedy Green - 26 Jul 2007 14:20 GMT
>for example, if A.java want to import the class B.C.D. but it write
>the import statement like this:

It would violate sun naming conventions to call a class B.C.D.
see http://mindprod.com/jgloss/naming.html
and http://mindprod.com/jgloss/codingcoventions.html

You might call it b.c.D where b.c is the package name.

You might have a nested inner class with D inside C inside B.  In that
case you just import the outermost class B.

In any case you just import the outermost class B.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

bubble601@gmail.com - 27 Jul 2007 04:36 GMT
I download the the project techus(http://svn.billen.dk/dk.teachus/
releases/teachus-1.9/) which is based on wicket framework(http://
wicket.sourceforge.net/).

for example, in the file TechUsApplication.java( under directory src
\main\java\dk\teachus\frontend),
it import class WebApplication like this:
import wicket.protocol.http.WebApplication; (line 16),

however the real package for this class(WebApplication) is :

org.apache.wicket.protocol.http.WebApplication;

it seems that org.apache has been omitted.

BTW: WebApplication is not an inner class.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.