-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod_practice_23.java
More file actions
41 lines (22 loc) · 864 Bytes
/
Copy pathmethod_practice_23.java
File metadata and controls
41 lines (22 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package Java_practice;
public class method_practice_23 {
static void change_integer(int x)
{
x=78;
}
static void change_array(int [] arr)
{
arr [0]=80;
}
public static void main(String[] args) {
//Will check after using the method original value of variable will change or not in Array
int a=45;
change_integer(a); // change_integer method used
System.out.println("Value of integer will not change it will be same " +a);
System.out.println("************|Ends Here|**********");
//Will check after using the method original value of variable will change or not in Array
int[] marks={34,34,56,56,43,45};
change_array(marks);
System.out.println("Value of Array will change as the array passes the references " +marks[0]);
}
}