Java Mastery Roadmap - Day 1
Day 1: Java Basics + Setup + Logic Programs
1. Java Setup
- Install JDK from Oracle
- Use IntelliJ IDEA or Eclipse IDE
- Online Compiler: Programiz
2. First Java Program
class Main {
public static void main(String[] args) {
[Link]("Hello, Pooja!");
3. Input with Scanner
import [Link];
Scanner sc = new Scanner([Link]);
String name = [Link]();
4. Logic Programs
- Palindrome Number:
Check if a number reads the same backward.
- Swap without 3rd variable:
Using + and - operations to swap values.
- Armstrong Number:
Sum of cubes of digits equals the number.
- Even or Odd:
Using modulo operator (%).
- Print 1 to N:
Using for loop.
5. Theory Recap
- Java is Object-Oriented.
- Scanner: For input.
- Data Types: int, float, char, boolean.
- Variables: Store data.
- [Link](): Output to console.
6. Interview Q&A
Q1: What is Java?
A: Java is a platform-independent, object-oriented language.
Q2: What is the entry point of Java?
A: public static void main(String[] args)
Q3: How to take user input?
A: Using Scanner class.
7. Homework
- Factorial
- Prime Number Check
- Reverse a String
- Count Digits
- Sum of Digits
You're on your journey to mastering Java. Stay consistent and focused!