View Single Post
Old 07-09-2009, 06:26 PM   #8 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,230
Belisarius is on a distinguished road
Java using something called a "CLASSPATH". It's an environmental variable that tells Java "this is where my files are". It will frequently look something like ".;c:/myjavafiles;c:/mylibs". It's a collection of system paths. For the most part, Netbeans will take care of it for you.

Additionally, you use something called "packaging". When you have a statement like
Code:
import javax.swing.*;
you're including all the files in the "javax.swing" package. Java looks through all the files in the CLASSPATH and picks out all the ones that start with
Code:
package javax.swing;
All Java programs start with the "static public void main(String[] args)" method. When you run a Java program, it executes the code in that method. While a Java program can be very large, with many classes and methods, the only one executed when a Java program is run is the "main" method. It's from that method that the rest of the code is called.
__________________
GitS
Belisarius is offline   Reply With Quote