0% found this document useful (0 votes)
2 views3 pages

Java Basics and Logic Programs Guide

Uploaded by

Pooja Gidde
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Java Basics and Logic Programs Guide

Uploaded by

Pooja Gidde
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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!

You might also like