Skip to content

Commit f5ab837

Browse files
authored
Add files via upload
1 parent 8ccab59 commit f5ab837

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: Methods/ReturningValues1.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class Test
2+
{
3+
int[] getarray()
4+
{
5+
int[] arr=new int[3];
6+
arr[0]=1;
7+
arr[1]=2;
8+
arr[2]=8;
9+
return arr;
10+
}
11+
}
12+
public class ReturningValues1 {
13+
public static void main(String[] args) {
14+
Test obj=new Test();
15+
int[] array=obj.getarray();
16+
System.out.println("Item1:"+array[0]);
17+
System.out.println("Item2:" + array[1]);
18+
System.out.println("Item3:" + array[2]);
19+
20+
}
21+
22+
}

0 commit comments

Comments
 (0)