This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes Can Import create a directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark "Can Import create a directory "planets"" Watch "Can Import create a directory "planets"" New topic
Author

Can Import create a directory "planets"

René van der ven
Greenhorn

Joined: Oct 25, 2009
Posts: 8

package com.scjaexam.tutorial;

- This statements creates the directories: com\scjaexam\tutorial

However a directory planets is created as well

import com.scjaexam.tutorial.planets.*;

-Is it true that the line above creates the directory planets?

Thanks in advance for your reply.

All the code
===================================
package com.scjaexam.tutorial;
import com.scjaexam.tutorial.planets.*;

public class GreetingsUniverse {

public static void main(String[] args) {
System.out.println("Greetings, Universe!");

Earth e = new Earth();
Mars m = new Mars();
Venus v = new Venus();
}
}


Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

No, the simple import won't create a directory for you, however, some GUI tools will.

The import name is simply a reference to a folder structure. So, when a class is in a given 'package', that class must be in a folder structure that is the same as the package. You'd have to create the folder structure manually.

-Cameron McKenzie
 
jQuery in Action, 2nd edition
 
subject: Can Import create a directory "planets"
 
Similar Threads
<indentifier> expected
compiling packages with javac using appropriate directory structure
ArrayList: How do you retrieve an item in an ArrayList and use that item for another purpose?
Need help with static methods.