Hi,
I got it from Deepak Bala's website.
Can anyone tell me what is the output?
class arraymock
{
public static void main(
String args[])
{
int[] arr={1,2,3,4,5};
int[] aar2=new int[4];
arr2=arr; //cannot find symbol in arr2=arr
System.out.println(arr2[4]); //cannot find symbol in arr2[4]
}
}
when i tried this i got these 2 errors,but the answer given is it prints 5.
if this is true ,please clear me ...
Thanks in advance
Preparing
scjp 1.5