Installing JDK
⇒ Search JDK Download
⇒ Make sure to download from the oracle website.
⇒ Download the latest version
First Class using Text Editor
import java.lang*;
public class First {
public static void main(string[] args){
System.out.println("Hello World");
}
}
Compiling and Running
⇒ By open terminal go to file location and write javac FileName.java .
→ It convert fileName.java into a FileName.class
⇒ Run by java FileName
Anatomy of a Class
⇒ Add a image of anatomy by writitng
File Extensions
⇒ .Java
→ Contains Java Source Code → High Level Human Readable → Used for Development → File is editable
⇒ Class
→ Contains Java Bytecode → For consumption of JVM → Used for Execution → Not meant to be edited
JDK vs JVM vs JRE
⇒ JDK
→ It's a software development kit required to develop Java applications.
→ Includes the JRE, an interpreter/loader (Java), a compiler (javac), a doc generator (Javadoc), and other tools needed for Java development.
→ Essentially, JDK is a superset of JRE
⇒ .JRE
→ t's a part of the JDK but can be downloaded separately.
→ Provides the libraries, the JVM, and other components to run applications
→ Does not have tools and utilities for developers like compilers or debuggers.
Showing Output
⇒ Add image
Importance of the main method
⇒ Entry Point: It's the entry point of a Java program, where the execution starts. Without the main method, the Java Virtual Machine (JVM) does not know where to begin running the code.
⇒ Public and Static: The main method must be public and static, ensuring it's accessible to the JVM without needing to instantiate the class.
⇒ Fixed Signature: The main method has a fixed signature: public static void main(String[] args). Deviating from this signature means the JVM won't recognize it as the starting point.
Installing IDE(Intellij Idea)
⇒ IDE stands for Integrated Development Environment.
⇒ Software suite that consolidates basic tools required for software development.
⇒ Central hub for coding, finding problems, and testing.
⇒ Designed to improve developer efficiency
Need of IDE
⇒ Streamlines development.
⇒Increases productivity.
⇒ Simplifies complex tasks.
⇒ Offers a unified workspace.
⇒ IDE Features
1. Code Autocomplete
2. Syntax Highlighting
3. Version Control
4. Error Checking