package - the folder/package** the class is in
importing leads to the package and then the class allowing you to use public methods within that class
|
YES im new to coding.
What is "package" and "importing?
[CODE]package net.com.codeusa.net;
import java.util.Hashtable;
import java.util.Map;[CODE]
package is the name of the file if u want to import it into another file? importing is the "import (location here)" bit? what does importing do? whats it's use?
package is a reference to the source folder the class file is located.
import 'links' other class files to the class files so they can be used.
Instead of importing you could always do :-
com.src.folder.ClassFile.method(); lol.
A class is a .JAVA file, and a .class file once compiled, it's the file/s with the code in.
EDIT2 : static is a modifier which makes that piece of code accessable from all classes of the same type without change, perhaps you should give this a read :-
http://java.sun.com/docs/books/tutorial/index.html
Then download a source, mess around with it, change some stuff and voila .
Got the first bit kinda =|
What do you mean by
And when you build/compile, well in codeusa/Z525 you only build "Engine.java" and in there is loads of imports, so does it work like, it makes Engine.java (compiles it) into a .class, and then compiles the imports, and THOSE imports have more and more imports that Engine.java didnt have, so it's like a long chain till it has nothing more to compile?
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |