File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
TecmaxPractise/src/com/tecmax/methodExamples Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .tecmax .methodExamples ;
2+
3+
4+ import java .lang .reflect .Array ;
5+ import java .util .Arrays ;
6+ import java .util .List ;
7+
8+ public class ArraytoArraylistDemo {
9+
10+
11+
12+ public static void main (String [] args ) {
13+ // TODO Auto-generated method stub
14+ String [] sa = {"swetha" ,"madhuri" ,"nandini" };
15+ List <String > abList = Arrays .asList (sa );
16+ System .out .println (abList );
17+ }
18+
19+ }
Original file line number Diff line number Diff line change 11package com .tecmax .methodExamples ;
22
3+ import java .util .ArrayList ;
4+
35public class arraylist {
6+ public static void main (String [] args ) {
7+ // TODO Auto-generated method stub
8+ ArrayList <String > a =new ArrayList <String >();
9+ a .add ("swetha" );
10+ a .add ("theja" );
11+ a .add ("joshna" );
12+ a .add ("priyanka" );
13+ System .out .println (a );
14+ a .add (0 ,"nandini" );
15+ System .out .println (a );
16+ int pos =a .indexOf ("madhuri" );
17+ String str =a .get (12 );
18+ int numberofitems =a .size ();
19+ System .out .println ("current arraylist position stringvalue size is:" +"\n " + numberofitems );
20+ a .remove ("dileep" );
21+ System .out .println (a );
22+
23+ }
24+
425
526}
You can’t perform that action at this time.
0 commit comments