File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
TecmaxPractise/src/com/tecmax/methodExamples Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 11package com .tecmax .methodExamples ;
22
3+ import java .util .ArrayList ;
4+
35public class arrays {
6+ public class array {
7+
8+ public static void main (String [] args ) {
9+ // TODO Auto-generated method stub
10+ ArrayList <String > a =new ArrayList <String >();
11+ a .add ("nan" );
12+ a .add ("madhuri" );
13+ a .add ("swetha" );
14+ a .add ("dileep" );
15+ System .out .println (a );
16+ a .remove ("swetha" );
17+ System .out .println (a );
18+ int pos =a .indexOf ("Theja" );
19+ String str =a .get (12 );
20+ int numberofitems =a .size ();
21+ System .out .println ("current array List posiion Stringvalue size is:" +"\n " +a +"\n " +numberofitems );
22+
23+ }
24+
25+ }
26+
27+ public static String [] asList ;
428
529}
Original file line number Diff line number Diff line change 1+ package com .tecmax .methodExamples ;
2+
3+ import java .awt .List ;
4+ import java .util .Arrays ;
5+
6+ public class arraytoarraylist {
7+
8+ public static void main (String [] args ) {
9+
10+ // TODO Auto-generated method stub
11+ String [] a = { "dillu" , "dillo" , "sweha" };
12+ List <String > aa =Arrays .asList (a );
13+ System .out .println (aa );
14+
15+ }
16+
17+ }
You can’t perform that action at this time.
0 commit comments