public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 1;
Integer b = new Integer("1");
Integer c = a;
int result = b + a;
int[] f = new int[1];
System.out.println(result);
check(b);
check1(f);
Integer K = new Integer(10);
int J = K.intValue();
System.out.println(b + " " + f[0] );
if(b.equals(a))
System.out.println(a);
}
static void check(Integer d)
{
d = 20;
}
static int[] check1(int[] a)
{
a[0] = 20;
return a;
}
first I'm curious to use primitive variable and reference variable.
let me know how to show
System.out.println(b)
output
20
array is reference type, and int is primitive type.
and Integer is reference type. but It is not changed from 1 to 2