Commit 36ad56bf authored by michael lundquist's avatar michael lundquist
Browse files

Adding this before I delete it for a better version.

parent 003941d5
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Random;
......@@ -7,6 +9,23 @@ public class Examples{
public Object[] deepClone(Object[] o){
Class oType = o.getClass();
Object[] newClone = Array.newInstance(oType, o.length);
for(int k=0; k < contacts.length; k++){
Method clone = o[k].getMethod("clone", new Class[0]);
newClone[k] = (Object) clone.invoke(obj, args);
}catch(NoSuchMethodException e){
return newClone;
* fills an array with random elements
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment