Code subject: Passing arrays as function parameter in java
Posted: Sun Aug 09, 2009 10:29 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
You have to knew the difference between passing the array as parameter in following two cases : 1. Assigning objects to the array of reference before the calling of function: .
Code:
public static void main(String[] args) { byte[] arr=new byte[3]; byte[] x= calc(arr); // in this case x = arr ( not null); }