Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert arraylist array into integer array in java
How to convert arraylist array into integer array in java
Import? Java . util . ArrayList;

Public? Class? JavaArrayList{?

Public? Static electricity Invalid? main(String[]args)?

{//Initialization of Java Dynamic Array

Array list? al=new? ArrayList();

//Add the data al.add(a) to the Java dynamic array; al . add(b); al . add(c); //output Java dynamic array

for(int? I = 0; I & ltal. size (); i++)?

{?

String? alEach =(String)al . get(I);

system . out . println(alEach); ?

}//Delete one element in the array and delete the second element.

al . remove( 1);

//Modify the Java dynamic array and put the new elements in the second position.

al.add( 1,2);

//output Java dynamic array