PCDS Tutors — Home • Online • Academic • Professional LearningServing 10+ launch cities • Expanding across India
Practical learning guideBeginner

Java: Tutorial, Projects & Course Syllabus

Core Java, OOP, collections, concurrency, testing and backend fundamentals.

Who this is for

Students, engineers and job seekers

Before you start

JDK 17 or later; basic variables and arithmetic.

Practical lesson

Build a tuition fee calculator with Java

Use a record to represent a lesson without mutable fields.

A collection can be filtered and reduced to a total. Store whole rupees as integers in this exercise; use an exact decimal or minor units for fractional money.

Set up your practice environment

Save as FeeDemo.java and run java FeeDemo.java.

java
import java.util.List;
public class FeeDemo {
  record Lesson(int hours, int rate, boolean completed) {}
  public static void main(String[] args) {
    var lessons = List.of(new Lesson(2, 500, true),
        new Lesson(1, 700, false), new Lesson(3, 400, true));
    int total = lessons.stream().filter(Lesson::completed)
        .mapToInt(l -> l.hours() * l.rate()).sum();
    System.out.println(total);
  }
}

Expected result

2200

Walk through the example

  1. The filter excludes the uncompleted lesson.
  2. mapToInt converts each remaining lesson into a charge: 1000 and 1200.
  3. sum returns 2200; the original list is unchanged.

Common mistake

Do not compare String values using ==; use equals. Avoid floating-point arithmetic for financial totals.

Try it yourself

Add a completed lesson of 2 hours at ₹600. What is the total? How would you reject a negative rate?

Reveal suggested solution

The total becomes 3400. Add a compact record constructor that throws IllegalArgumentException if hours or rate is negative.

Portfolio project brief

Create a monthly tuition ledger with immutable lesson records, student IDs, completed/cancelled status and a CSV summary.

Acceptance criteria

  • Reject invalid hours and rates.
  • Separate totals by student.
  • Test empty, cancelled and completed lesson cases.

This is a project specification, not a completed downloadable project. Build and test it independently or with a mentor.

Quick self-test

Choose one answer per question, then check your score. No sign-in required.

1. Which operation excludes cancelled lessons?
2. What does sum on an empty IntStream return?

Complete learning roadmap

These are suggested course modules, not a claim that every module has a full tutorial on this site.

  1. 01Java foundations
  2. 02OOP & clean design
  3. 03Collections & generics
  4. 04Exceptions & I/O
  5. 05Concurrency
  6. 06Testing & project

Learning outcomes

  • Write production-style Java
  • Apply OOP correctly
  • Build a portfolio project

Continue with official documentation

Original PCDS learning material. Check the official documentation for your installed software version; these guides are not vendor-endorsed courses.

Java learning resources →

Need help learning Java?

Choose a city and describe your learning goal in the enquiry form. Mention Java, your current level and whether you prefer home or online learning. Tutor availability and pricing are subject to confirmation.

Browse Java tutoring options in Mira Road or select a city above.

Java Tutorial, Practical Project & Course Syllabus | PCDS Learning