"Core Java"
is used to refer Java SE, the standard edition. In Core Java it includes many packages which are always considered to be part of JavaSE. The packages like applet, awt, io, lang, util, math are part of Core Java. This document explains how to write first program in Core Java and run it.
-
Prerequisite
For Java Program to run, first install Java.
-
Core Java Hello World Program
Create file named
HelloWorld.java
in any folder location on your machine. And write the following content in your java file.public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }
After writing this code in java file, compile the java file using
javac
command. Open a command prompt and go to path where the.java
file is saved. Run the compiler to compile the Java Source code and convert it into java bytecode.class
file. And then run the java program with the class name.