I try to print reverse of the entering number without any for loop. But I've got some issues with printing the Arraylist. How can I print the Arraylist [3, 5, 4, 1] as 3541 - without brackets, commas and spaces?
If not possible, how can I add my ArrayList elements to stringlist then print?
public static void main(String[] args) {
int yil, bolum = 0, kalan;
Scanner klavye = new Scanner(System.in);
ArrayList liste = new ArrayList();
//String listeStr = new String();
System.out.println("Yıl Girin: "); // enter the 1453
yil = klavye.nextInt();
do{ // process makes 1453 separate then write in the arraylist like that [3, 5, 4,1]
kalan = yil % 10;
liste.add(kalan);
bolum = yil / 10;
yil = bolum;
}while( bolum != 0 );
System.out.println("Sayının Tersi: " + ....); //reverse of the 1453
klavye.close();
}