Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: Question ab...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 20 Topic 15992 of 16078
Post > Topic >>

Re: Question about the package directive

by rossum <rossum48@[EMAIL PROTECTED] > Apr 20, 2008 at 01:10 PM

On 20 Apr 2008 00:16:35 GMT, I_Am_The_Walrus
<I_Am_The_Walrus@[EMAIL PROTECTED]
> wrote:

>
>I was reading a Java book tonight and it was talking about the
>"package" directive.  I haven't seen it used anywhere.  Did it die
>with one of the more recent versions or is it just obsolete but still
>available?
The package directive appears at the start of most real world Java
source files, it indicates which package each source file belongs to.
When you are just starting Java you will see it rarely because the
small example programs in the books do not usually bother - each small
program concentrates on just one aspect of the language to make the
example easier to understand.

The package directive is the other side of the import statement.  When
you say "import java.util" that implies that somewhere there is a
group of source files that start "package java.util".  The import
statement will import all the classes in the files that are marked for
that package, i.e. all those files that start "package java.util".

It is far from obsolete and is very important when organising a large
project.

HTH

rossum




 20 Posts in Topic:
Question about the package directive
I_Am_The_Walrus <I_Am_  2008-04-20 00:16:35 
Re: Question about the package directive
Mark Space <markspace@  2008-04-19 18:32:50 
Re: Question about the package directive
Lew <lew@[EMAIL PROTEC  2008-04-19 23:04:34 
Re: Question about the package directive
Roedy Green <see_websi  2008-04-20 10:06:01 
Re: Question about the package directive
Roedy Green <see_websi  2008-04-20 10:07:47 
Re: Question about the package directive
xinxin <jnzhouxinxin@[  2008-04-20 04:15:07 
Re: Question about the package directive
rossum <rossum48@[EMAI  2008-04-20 13:10:01 
Re: Question about the package directive
I_Am_The_Walrus <I_Am_  2008-04-20 16:05:57 
Re: Question about the package directive
Mark Space <markspace@  2008-04-20 11:59:41 
Re: Question about the package directive
I_Am_The_Walrus <I_Am_  2008-04-21 00:33:19 
Re: Question about the package directive
Mark Space <markspace@  2008-04-20 20:29:09 
Re: Question about the package directive
I_Am_The_Walrus <I_Am_  2008-04-21 23:53:03 
Re: Question about the package directive
Roedy Green <see_websi  2008-04-24 09:55:40 
Re: Question about the package directive
Patricia Shanahan <pat  2008-04-24 06:58:43 
Re: Question about the package directive
ram@[EMAIL PROTECTED] (S  2008-04-24 13:54:37 
Re: Question about the package directive
Roedy Green <see_websi  2008-04-27 10:47:57 
Re: Question about the package directive
Lew <lew@[EMAIL PROTEC  2008-04-27 08:50:21 
Re: Question about the package directive
ram@[EMAIL PROTECTED] (S  2008-04-27 13:07:50 
Re: Question about the package directive
John W Kennedy <jwkenn  2008-04-22 14:22:56 
Re: Question about the package directive
Lew <lew@[EMAIL PROTEC  2008-04-22 21:57:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 8:04:58 CDT 2008.