170 likes | 240 Views
Explore how to create, compile, run Java applications using NetBeans. Learn adding classes, importing from external jars, and handling compilation errors. Easily code new programs by adding classes to the project.
E N D
Developing Java Applications with NetBeans http://www.netbeans.org
We can delete everything and leave just the following package javaapplication1; Name of the project public class Main { Name of the class (file) public static void main(String[] args) { this is to mark the beginning of the instructions of the program } This marks the end of the program } This marks the end of the class
The file containing the new classes will be added during compilation and execution
Telling the compiler to “import” a certain class from the jar file • At the top of the program you have to write import <package>.Console; • Package is the name of the pacakge containing the classes (in this case, JConsole) package javaapplication1; import JConsole.*; public class Main { public static void main(String[] args) { Console c = new Console(); for (int i = 1; i <= 10; i++) for (int j = 1; j <= 10; j++) c.println(i+“ * “+j+” = “+i*j); } }
For more programs you just need to add classes to the project