aspose file tools*
The moose likes Beginning Java and the fly likes Help with these import statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with these import statements" Watch "Help with these import statements" New topic
Author

Help with these import statements

Adam Wilkins
Greenhorn

Joined: Oct 19, 2005
Posts: 24
What do these import statements actually do? Do they go to Sun's site and grab the classes?

import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;

How can I look at the API for the SimpleUniverse and ColorCube classes?
Raymond Villeno
Ranch Hand

Joined: Jun 21, 2005
Posts: 63
Originally posted by Adam Wilkins:
What do these import statements actually do? Do they go to Sun's site and grab the classes?

import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;

How can I look at the API for the SimpleUniverse and ColorCube classes?



Nope it does not... its like in c/c++ import it does not connect to the web and gets the package there.. better check the source if you package if any if there is not try going to the site where you ahve downloaded it.

Cheers!


"Work Smart Not Hard"
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
Originally posted by Adam Wilkins:
What do these import statements actually do? Do they go to Sun's site and grab the classes?

import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;

How can I look at the API for the SimpleUniverse and ColorCube classes?


Specifically these ones? Depends on the code. Maybe you can post the code?


ASCII silly question, Get a silly ANSI.
k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
A google for the javadocs may also turn up something:

http://download.java.net/media/java3d/javadoc/1.4.0-latest/com/sun/j3d/utils/geometry/package-tree.html

http://download.java.net/media/java3d/javadoc/1.4.0-latest/com/sun/j3d/utils/universe/package-tree.html

But make sure they are for the version of java you are using
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Import statements don't "do" anything. They are simply declarations.

For the example "import com.sun.j3d.utils.universe.SimpleUniverse", this declares that whenever you mention the class "SimpleUniverse" in your code, perhaps by declaring a variable of that class, the compiler should assume that you actually mean the class "com.sun.j3d.utils.universe.SimpleUniverse" and not some other "SimpleUniverse" class in some other package.

Now the compiler will complain if that class is not in your classpath, I am sure you have seen that already. But your classpath is entirely composed of directories and jar files on your own computer. It doesn't contain anything elsewhere on the network.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with these import statements