JDK
Source: Dev.to
What is JDK?
JDK is a complete software package used to develop Java applications.
It contains tools to write, compile, debug, and run Java programs.
When is JDK used?
- When you are writing Java code.
- When you are compiling a Java program.
- During development time.
How JDK is used?
- Write a
.javafile. - Use
javac(the compiler from the JDK) to convert it to a.classfile. - Run the program using the
javacommand.
Example
// Hello.java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
javac Hello.java
java Hello