Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f6094ac

Browse files
Create DynamicArray.java
1 parent e27f6c7 commit f6094ac

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import java.util.*;
2+
public class DynamicArray{
3+
public static void main(String[] args){
4+
Scanner cin=new Scanner(System.in);
5+
int n=cin.nextInt();
6+
//operations on array
7+
ArrayList<Integer> list=new ArrayList<>();
8+
for(int i=0;i<n;i++){
9+
list.add(cin.nextInt());
10+
}
11+
for(Integer i:list){
12+
System.out.println(i);
13+
}
14+
}
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /