here is my code:
package com.company; class Roman { private Roman []roman = new Roman[20]; String author; String name; int data; int size; String genre; Roman(){ } Roman(String author,String name,int data, int size,String genre){ this.author= author; this.name=name; this.data=data; this.size=size; this.genre=genre; } void print(Roman rom){ System.out.println("ΠΠ°Π·Π²Π°Π½ΠΈΠ΅ : "+rom.name); System.out.println("ΠΠ²ΡΠΎΡ : "+rom.author); System.out.println("ΠΠΎΠ΄ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ : "+rom.data+" Π³."); System.out.println("Π Π°Π·ΠΌΠ΅Ρ : "+rom.size+" Π‘ΡΡΠ°Π½ΠΈΡ"); System.out.println("ΠΠ°Π½ΡΡ : "+rom.genre); System.out.println("\n"); } /*void minyear(){ int min = roman[0].data; for(int i=0;i<=roman.length;i++){ if(roman[i].data<min) min=roman[i].data; } System.out.println("Π‘Π°ΠΌΠ°Ρ ΡΡΠ°ΡΡΠΈΠΉ ΡΠΎΠΌΠ°Π½ : "+min); }*/ } public class Main { public static void main(String[] args) { Roman []roman = new Roman[20]; Roman t; roman[0] = new Roman("ΠΠ²Π°Π½ Π‘Π΅ΡΠ³Π΅Π΅Π²ΠΈΡ Π’ΡΡΠ³Π΅Π½Π΅Π²","ΠΡΡΡ ΠΈ Π΄Π΅ΡΠΈ",1862,300,"ΠΡΠ±ΠΎΠ²Π½ΡΠΉ ΡΠΎΠΌΠ°Π½, Π€ΠΈΠ»ΠΎΡΠΎΡΡΠΊΠΈΠΉ ΡΠΎΠΌΠ°Π½, ΠΠΎΠ»ΠΈΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΡΠ°Π½ΡΠ°ΡΡΠΈΠΊΠ°"); roman[1] = new Roman("ΠΠ²Π°Π½ Π‘Π΅ΡΠ³Π΅Π΅Π²ΠΈΡ Π’ΡΡΠ³Π΅Π½Π΅Π²","ΠΡΠΌΡ",1854,35,"Π₯ΡΠ΄ΠΎΠΆΠ΅ΡΡΠ²Π΅Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΠ΅"); roman[2] = new Roman("ΠΠ²Π°Π½ Π‘Π΅ΡΠ³Π΅Π΅Π²ΠΈΡ Π’ΡΡΠ³Π΅Π½Π΅Π²","ΠΠ°ΠΏΠΈΡΠΊΠΈ ΠΎΡ
ΠΎΡΠ½ΠΈΠΊΠ°",1852,50,"Π₯ΡΠ΄ΠΎΠΆΠ΅ΡΡΠ²Π΅Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΠ΅"); roman[3] = new Roman("ΠΠ΅Π² ΠΠΈΠΊΠΎΠ»Π°Π΅Π²ΠΈΡ Π’ΠΎΠ»ΡΡΠΎΠΉ","ΠΠΎΠΉΠ½Π° ΠΈ ΠΌΠΈΡ",1867,1274,"Π ΠΎΠΌΠ°Π½, ΠΡΠ±ΠΎΠ²Π½ΡΠΉ ΡΠΎΠΌΠ°Π½, ΠΠΎΠ΅Π½Π½Π°Ρ ΠΏΡΠΎΠ·Π°, ΠΡΡΠΎΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΆΠ°Π½Ρ, Π€ΠΈΠ»ΠΎΡΠΎΡΡΠΊΠΈΠΉ ΡΠΎΠΌΠ°Π½"); roman[4] = new Roman("ΠΠ΅Π² ΠΠΈΠΊΠΎΠ»Π°Π΅Π²ΠΈΡ Π’ΠΎΠ»ΡΡΠΎΠΉ","ΠΠ½Π½Π° ΠΠ°ΡΠ΅Π½ΠΈΠ½Π°",1877,776,"Π ΠΎΠΌΠ°Π½, Π Π΅Π°Π»ΠΈΠ·ΠΌ, Π₯ΡΠ΄ΠΎΠΆΠ΅ΡΡΠ²Π΅Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΠ΅"); for(int i=0;i<=roman.length;i++) { roman[i].print(roman[i]); } } }
I could not create a function that receives the values ββof the entered books (for example, a function that recognizes the smallest number of pages, etc. I tried (taken as a comment)) help create a function when I try gives NPE