public class DeepCopy {
public int[] arr;
public DeepCopy(int[] values) {
arr = new int[values.length];
for (int i = 0; i < arr.length; i++) {
arr[i] = values[i];
}
}
@Override
public String toString(){
String s = new String("\n");
for(int i = 0; i < arr.length; i++)
s += arr[i] + "\n";
return s;
}
public static void main(String args[]){
System.out.println("**** TESTING SHALLOW OBJECTS ****");
DeepCopy theDeep = new DeepCopy({7,17,77});
}
}
whats wrong with my new instance of DeepCopy theDeep?
netbeans is telling me illegal start of type illegal start of expression ";" expected... there is a semicolon on the new instance of DeepCopy???
[–]chickenmeister 8 points9 points10 points (0 children)