Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Library Management System | Section
Fundamental Data Structures in Java

bookChallenge: Library Management System

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Library Management System

Veeg om het menu te tonen

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
single

single

some-alt