Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

java_anfaenger

User
  • Registriert

  • Letzter Besuch

Reputationsaktivität

  1. Positiv
    Ja die .txt ist so aufgebaut mit ",". Es funktioniert jetzt ohne Fehler nur gibt der nichts aus in der Konsole woran könnte es vermutlich liegen ?
  2. verwirrt
    Den Code verstehe ich... ich würde es aber in eine HashMap umwandeln wollen ..
  3. Like
    Ich würde eher vorschlagen, dass du dich mehr mit dem Prinzip der Objektorientierung auseinandersetzt. Es sieht sehr danach aus, als würdest du noch nicht so ganz verstehen, was du da machst.
    Um auf die einzelnen Buch-Daten zuzugreifen zu können, benötigst du erst mal eine Book Klasse
    public class Book { private string title; private BigDecimal price; private int edition; public Book(string title, BigDecimal price, int edition) { this.title = title; this.price = price; this.edition = editon; } public string getTitle { return this.title; } public BigDecimal getPrice { return this.price; } public int getEdition { return this.edition; } } eBooks und Audiobooks haben ja noch andere Eigenschaften als ein normales Buch. Daher musst du für diese noch zusätzliche Ableitungen schreiben, die dann von Book erben. (Stichwort "Vererbung")
     
    Dann könntest du die Liste so erstellen: (Ich beschränke mich hierbei auf die Eigenschaften von Book)
    public static List<Book> getSelledBooks() { List<Book> result = new ArrayList<Book>(); result.add(new EBook("booktitle1", 19.99, 2020)); result.add(new EBook("booktitle2", 4.99, 2020)); result.add(new AudioBook("booktitle3", 22.99, 2016)); result.add(new EBook("booktitle4", 4.99, 2020)); return result; } Dann kannst du auch die Preise einfach mit der getPrice()-Methode auslesen.
    Aber ich würde dir empfehlen, ein Tutorial durchzuarbeiten, um das Prinzip der Objektorientierung zu verstehen.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.