Java_Learning_Guide
Java_Learning_Guide
Java is a high-level, object-oriented, platform-independent language. You write once and run anywhere.
Structure:
System.out.println("Hello, Java!");
Basic Types:
Chapter 3: Operators
Java Learning Guide - Step by Step
Operators:
Arithmetic: + - * / %
Logical: && || !
Example:
System.out.println(a + b); // 30
If-Else:
else System.out.println("Fail");
Switch:
int day = 3;
Chapter 5: Loops
For Loop:
int i = 1;
Chapter 6: Arrays
Array:
System.out.println(marks[1]); // 80
2D Array:
Chapter 7: Strings
String Methods:
Example:
String s = "Java";
System.out.println(s.length());
Inheritance:
Try-Catch:
ArrayList:
Java Learning Guide - Step by Step
ArrayList<String> names = new ArrayList<>();
names.add("Ravi");
System.out.println(names.get(0));
1. ATM Simulator
2. Simple Calculator
4. Quiz Game