Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » functional difference between import nameOfPackage & package nameOfPackage
Closed Thread
Old 10-29-2006, 06:56 PM   #1 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default functional difference between import nameOfPackage & package nameOfPackage

Hello

i was just wondering about the code line

import nameOfPackage.*;

and

package nameOfPackage;

command in java
are the two command interchangable, providing access to all protected variables within the Mammals package?
rookie1010 is offline  
Old 10-30-2006, 12:31 AM   #2 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

No, the commands are not interchangeable. With all the fundamental questions you are having about Java, you may want to purchase a book and read it. A book would benefit you more at this point than posting several questions like this on an internet forum.
jaeusm is offline  
Old 10-30-2006, 06:13 AM   #3 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

thanks for the reply

i am actually going through an online tutorial and cant get the example code about packages and imports going

hence the question
rookie1010 is offline  
Old 10-30-2006, 10:03 AM   #4 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Online tutorials are ok, but you'll find a good book will benefit you more at this point.
jaeusm is offline  
Old 10-30-2006, 11:03 AM   #5 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

can you recommend a good book for java programming?
rookie1010 is offline  
Old 10-30-2006, 11:38 AM   #6 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

The most thorough and complete book (as well as technically accurate) is "Thinking in Java" 4th edition by Bruce Eckel. There are many other good books, but Eckel is extremely thorough and very clear in his writing. If you decide to pick up this book, make sure to get the 4th edition, as it covers Java 1.5.
jaeusm is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On