Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with these import statements

 
Adam Wilkins
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Stuart Ash
Ranch Hand
Posts: 637
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
k Oyedeji
Ranch Hand
Posts: 96
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic