Új hozzászólás Aktív témák
-
Ablakos
addikt
Egy kis szakértést szeretnék kérni, mert nem tudom megfejteni miért nem akar a contains metodus nekem működni.
(book class a simple pojo)public static void main(String[] args) {Scanner scanner = new Scanner(System.in);ArrayList<Book> books = new ArrayList<>();while (true) {System.out.println("Name (empty will stop):");String name = scanner.nextLine();if (name.isEmpty()) {break;}System.out.println("Publication year:");int publicationYear = Integer.valueOf(scanner.nextLine());Book book = new Book(name, publicationYear);if (books.contains(book)) {System.out.println("The book is already on the list. Let's not add the same book again. \n Name (empty will stop):");} else {books.add(book);}System.out.println("Thank you! Books added: " + books.size());}for(Book b:books) {System.out.println(b.getName() + " " + b.getPublicationYear());}}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Bontatlan Intel Core ULTRA 9 285K (24mag!) + hűtött VRM-es Z890 alaplap! GAR/SZÁMLA (a Te nevedre)!
- Printive - 3D nyomtatás - kedvező árak - azonnali árajánlat
- AOC Q27G4ZR 1440p IPS 27" 240Hz 1ms G-Sync monitor 2.5 év garanciával
- Eladó Akai MPK Mini MIDI controller
- Wacom DTU-1631 - Digitalizáló rajztábla - 15,6" HD - Több db
- iKing.Hu - Apple iPhone 13 Pro Max Graphite ProMotion 120 Hz, Pro kamerák 256 GB-100%-3 hó gari!
- Jura Impressa S90 Automata kávégép 6 hónap Garancia Beszámítás Házhozszállítás
- Apple iPhone 15 128GB, Kártyafüggetlen, 1 Év Garanciával
- Dell Latitude 5420 14" Touchscreen i5-1135G7 16GB 512GB 1 év garancia
- GYÖNYÖRŰ iPhone XR 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS4270, 100% Akkumulátor
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: Laptopműhely Bt.
Város: Budapest
(book class a simple pojo)
