AI Instructor Live Labs Included

Java Programming Fundamentals

Learn Java from scratch by building a Library Management System. Covers core syntax, OOP, collections, and interfaces through 16 paired teaching and coding lessons.

Beginner
18h 10m
16 Lessons
SMU-JAVA-FUND
Java Programming Fundamentals Badge

View badge details

About This Course

A comprehensive introduction to Java programming for developers new to the language. Through 16 guided lessons, you'll build a complete Library Management System console application starting from a simple Hello World program and growing it lesson by lesson into a full in-memory CRUD system with menus, validation, collections, and interfaces. Each teaching lesson is paired with hands-on coding exercises in VS Code using JDK 21 and Maven.

Course Curriculum

16 Lessons
01
AI Lesson
AI Lesson

Hello World & Java Setup

40m

Learn what Java is, how the JVM works, how Maven projects are structured, and how to write your first Java program. Covers the main method, System.out.println, string concatenation, printf formatting, and Java comments.

02
Lab Exercise
Lab Exercise

Hello World - Lab Exercises

1h 30m 3 Exercises

Hands-on coding exercises to run your first Maven project, print a welcome banner using System.out.println and printf, and declare your first Java variables for a Book object.

Run the Project and Read the Structure Open the integrated terminal and run mvn compile then mvn exec:java to observe the stub output. Identify pom.xml, src/main/java/com/skillmeup/library/Main.java, and understand the Maven project layout. ~15 min
Print the Library Banner Replace the TODO in main() to print a multi-line welcome banner using System.out.println() and a formatted status line using System.out.printf() with a string and integer variable. ~15 min
Declare Your First Book Variables Declare local variables in main() for a book's title (String), author (String), year (int), and available (boolean). Print each variable using concatenation and printf to observe Java's explicit typing requirements. ~15 min
03
AI Lesson
AI Lesson

Variables, Types & Operators

45m

Learn Java primitive types (int, long, double, boolean, char), String as a reference type, variable declaration and initialization, arithmetic and string operators, type casting, and common type-related errors.

04
Lab Exercise
Lab Exercise

Variables - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to add typed fields to the Book class, instantiate Book objects in Main, and practice String operations and type casting in the Library Management System.

Add Typed Fields to Book Open Book.java and replace TODOs with typed instance fields (String title, String author, String isbn, int year, boolean available). Add a constructor initializing all five fields and a toString() method returning a formatted string. ~15 min
Instantiate and Print a Book in Main In Main.java, after the banner, instantiate a Book with sample data and print it using toString(). Add a second book and print both books. ~15 min
String Operations and Type Casting Print the book's ISBN length using isbn.length(), calculate how many years ago a book was published using int arithmetic then cast to double for a precision display, and demonstrate String.equals() to compare two ISBNs. ~15 min
05
AI Lesson
AI Lesson

Control Flow

45m

Learn if/else if/else, switch statements (traditional and arrow syntax), while and do-while loops, for and for-each loops, break and continue, and Scanner for console input. All examples build toward the Library Management System menu.

06
Lab Exercise
Lab Exercise

Control Flow - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to add a getStatusLabel() method to Book using if/else, build a do-while menu loop in Main with switch, and add input validation with while and for loops.

Add Availability Validation to Book Open Book.java and add a getStatusLabel() method that returns "Available" or "Checked Out" using an if/else. Update toString() to include the status label. ~15 min
Build the Main Menu Loop In Main.java, add a do-while loop displaying a menu with options: 1) Add Book, 2) List Books, 3) Exit. Use a switch on the user's choice to print a stub message for each option. Loop continues until the user selects 3. ~15 min
Input Validation Add a while loop inside the menu that re-prompts the user if they enter a number outside 1-3. Add a for loop that prints "Initializing..." five times before the menu appears, simulating a startup sequence. ~15 min
07
AI Lesson
AI Lesson

Methods & Functions

45m

Learn method declaration anatomy, static vs instance methods, parameters and return values, method overloading, scope, local variables, and the this keyword — all in the context of the Library Management System.

08
Lab Exercise
Lab Exercise

Methods - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to extract a printBookDetails method, add input helper methods (promptForString, promptForInt), and add static ISBN formatter and validator methods to Book.

Extract the Print Book Method Open Main.java and extract the book printing logic from case 2 of the switch into a private static method printBookDetails(Book book). Call the new method from the switch case. ~15 min
Add Input Helper Methods Add a static method promptForString(Scanner scanner, String label) that prints a prompt and reads a trimmed line. Add promptForInt(Scanner scanner, String label) with basic validation. Use these to collect book fields in the Add Book stub. ~15 min
Add a Static ISBN Formatter Add static formatIsbn(String raw) to Book.java that strips non-alphanumeric characters. Add static isValidIsbn(String isbn) returning true if the cleaned ISBN is exactly 10 or 13 characters. Call isValidIsbn() in a promptForIsbn() helper in Main.java. ~15 min
09
AI Lesson
AI Lesson

Object-Oriented Programming — Classes & Objects

50m

Learn the four pillars of OOP (encapsulation, inheritance, polymorphism, abstraction), encapsulation with private fields and public accessors, constructor overloading, and the Java trinity: toString(), equals(), and hashCode().

10
Lab Exercise
Lab Exercise

OOP - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to encapsulate the Book class with private fields and getters/setters, build the Patron class with constructors and equals/hashCode, and implement the BookCatalog class with ArrayList-backed CRUD operations.

Encapsulate Book Convert all public fields in Book.java to private. Add getters for all fields and setters only for title, author, and available. Add checkOut() and returnBook() methods with state validation. Fix any compile errors in Main.java caused by direct field access. ~15 min
Build the Patron Class Open Patron.java and implement private fields: patronId, name, email. Add a full constructor and a two-parameter constructor using this(). Add toString(), equals() (compare by patronId), and hashCode(). ~15 min
Implement BookCatalog Open BookCatalog.java, add a private List<Book> books = new ArrayList<>() field, and implement addBook(Book), findByIsbn(String), removeByIsbn(String), and getAllBooks(). Wire BookCatalog into Main.java so the Add Book and List Books menu options use it. ~15 min
11
AI Lesson
AI Lesson

Inheritance & Interfaces

50m

Learn inheritance with extends, abstract classes, interfaces as capability contracts, polymorphism, method dispatch, abstract vs interface trade-offs, and common casting errors.

12
Lab Exercise
Lab Exercise

Inheritance & Interfaces - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to make Book extend LibraryItem abstract class, implement the Loanable interface on Book, and wire the Library class to use Loanable for checkout operations.

Promote Book to Extend LibraryItem Open LibraryItem.java and review the abstract class. Modify Book.java to extend LibraryItem, remove fields now inherited from the parent, call super(isbn, title) in the constructor, and implement getDisplayType() returning "Book". ~15 min
Implement the Loanable Interface Open Loanable.java and review the interface methods. Add implements Loanable to Book.java and implement all four interface methods: checkOut(String patronId), returnItem(), isAvailable(), and getItemId(). ~15 min
Wire Library Together Open Library.java — it has List<Loanable> catalog and List<Patron> patrons fields. Implement addBook(Book), findBook(String isbn), checkOutBook(String isbn, String patronId), and returnBook(String isbn). Update Main.java to use Library instead of BookCatalog directly. ~15 min
13
AI Lesson
AI Lesson

Collections & Generics

45m

Learn the Java Collections hierarchy, ArrayList vs LinkedList, HashMap for O(1) lookups, HashSet for uniqueness, generics for type safety, bounded type parameters, wildcards, and ConcurrentModificationException.

14
Lab Exercise
Lab Exercise

Collections - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises to upgrade Library catalog from ArrayList to HashMap keyed by ISBN, implement the Loan class with LocalDate fields and isOverdue(), and add getOverdueLoans() to Library with a new menu option.

Upgrade Catalog to HashMap Open Library.java and replace List<Book> catalog with Map<String, Book> catalog = new HashMap<>(). Update addBook(), findBook(), and removeBook() to use map operations. Update the list-all-books operation to iterate catalog.values(). ~15 min
Implement the Loan Class and Loan Tracking Open Loan.java and implement fields: Book book, Patron patron, LocalDate checkoutDate, LocalDate dueDate (14 days from checkout). Add constructor, getters, and isOverdue() using LocalDate.now(). In Library.java, add List<Loan> activeLoans and Set<String> checkedOutIsbns. Update checkOutBook() to create Loan and update returnBook() to remove it. ~15 min
Display Overdue Loans Add getOverdueLoans() to Library.java returning List<Loan> using a for loop with loan.isOverdue(). Wire a new menu option "4. Show Overdue Loans" in Main.java that prints each overdue loan with patron name, book title, and due date. ~15 min
15
AI Lesson
AI Lesson

Capstone Briefing

30m

Review the complete Library Management System architecture, all concepts taught in the course, and explain the capstone project requirements: completing the loan creation logic, overdue detection, patron lookup, full menu integration, and error handling.

16
Lab Exercise
Lab Exercise

Capstone Project

1h 50m 3 Exercises

Build the complete Library Management System. Complete loan creation logic, implement overdue detection with getDaysOverdue(), integrate all 5 menu options with try-catch error handling, and verify the full application works end-to-end.

Complete Loan Creation Open Library.java. In checkOutBook(String isbn, String patronId): find the book by ISBN (throw IllegalArgumentException if not found), find the patron by ID (throw if not found), verify book is available (throw IllegalStateException if not), create a Loan, add to activeLoans, add ISBN to checkedOutIsbns, call book.checkOut(). In returnBook(String isbn): remove from checkedOutIsbns, find and remove the matching Loan, call book.returnItem(). ~25 min
Implement Overdue Detection Open Loan.java and implement isOverdue(): return true if LocalDate.now().isAfter(dueDate). Add getDaysOverdue() returning the number of days past the due date (0 if not overdue). In Library.java, implement getOverdueLoans() using a for loop to collect loans where loan.isOverdue() is true. ~20 min
Complete Menu Integration and Error Handling Wrap all Library calls in Main.java inside try-catch blocks catching IllegalStateException and IllegalArgumentException. Print user-friendly error messages (no stack traces). Add menu option 5 "Show Overdue Loans" formatting each overdue loan with patron name, book title, and days overdue. Run the full application and verify all 5 menu options work end-to-end. ~20 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 8 Hands-on Lessons
  • 6 Months Access
  • Completion Badge
  • Certificate of Completion
Java Programming Fundamentals Badge

Earn Your Badge

Complete all lessons to unlock the Java Programming Fundamentals achievement badge.

Category
Skill Level Beginner
Total Duration 18h 10m
Java Programming Fundamentals Badge
Achievement Badge

Java Programming Fundamentals

Awarded for completing the Java Programming Fundamentals course, demonstrating proficiency in Java syntax, control flow, methods, arrays, and basic OOP.

Course Java Programming Fundamentals
Criteria Complete all lessons and pass assessments in the Java Programming Fundamentals course.
Valid For 730 days

Skills You'll Earn

Java Syntax Control Flow Methods and Scope Arrays Object-Oriented Basics Exception Handling

Complete all lessons in this course to earn this badge