Java_Day1_Introduction_Detailed
Java_Day1_Introduction_Detailed
• Example:
• ```java
• public class HelloWorld {
• public static void main(String[] args) {
• System.out.println("Hello, World!");
• }
• }
• ```
Java Syntax and Structure
• - Java programs are structured in **classes**
and contain a `main()` method.
• - Every statement ends with a **semicolon
(;)**.
• - Curly braces `{}` define blocks of code.
• - Java is case-sensitive.
Variables and Data Types
• - **Primitive Data Types**: int, float, char, boolean, double,
etc.
• - **Reference Data Types**: Strings, Arrays, Objects.
• - Example:
• ```java
• int age = 20;
• double price = 99.99;
• boolean isJavaFun = true;
• ```
Installing Java and Setting Up
Environment
• - Download JDK from Oracle or OpenJDK.
• - Install an IDE (Eclipse, IntelliJ, VS Code).
• - Set up the `JAVA_HOME` environment
variable.
• - Verify installation using `java -version` and
`javac -version`.
Recap & Next Steps
• - Java is an object-oriented, platform-
independent language.
• - Java programs are compiled into bytecode
and run on JVM.
• - Learned Java syntax, variables, and program
structure.
• - Next: Data Types, Operators, and Control
Statements.