Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Library Management System | Section
Practice
Projects
Quizzes & Challenges
Quizze
Challenges
/
Fundamental Data Structures in Java

bookChallenge: Library Management System

Aufgabe

Swipe to start coding

Your task is to complete the Library class by filling in the missing parts:

  1. addBook(Book book) method:

    • Add the given book to the books list.
  2. findBooksByAuthor(String author) method:

    • Iterate over all Book objects in the books list.
    • For each book, check if its author matches the given author.
    • If it matches, add the book to a temporary list called result.
    • After the loop, return the result list.
  3. displayAllBooks() method:

    • Iterate over all Book objects in the books list.
    • For each book, print its ID, title, and author in a readable format.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 3
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Library Management System

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

Your task is to complete the Library class by filling in the missing parts:

  1. addBook(Book book) method:

    • Add the given book to the books list.
  2. findBooksByAuthor(String author) method:

    • Iterate over all Book objects in the books list.
    • For each book, check if its author matches the given author.
    • If it matches, add the book to a temporary list called result.
    • After the loop, return the result list.
  3. displayAllBooks() method:

    • Iterate over all Book objects in the books list.
    • For each book, print its ID, title, and author in a readable format.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 3
single

single

some-alt