Java Program - The execution flow diagramKnow the major steps involved in the execution cycle of a Java program.
Now let us write a simple program in Java to print current date and time.
import java.util.Date;
public class CurrentDatePrinter {
public static void main(String[] args) {
System.out.println(new Date());
}
}
Compile the Java program using the compiler provided by JDK and create class files: Open command prompt and type the command javac C:\skillrack\training\CurrentDatePrinter.java
This will create a file CurrentDatePrinter.class under C:\skillrack\training folder.
Ensure you navigate to C:\skillrack\training folder in the command prompt. Video Link: Watch the video explaining the above steps.
|