1-
>>JAVA5 is a static final boolean
import the class contains "JAVA5"
also change to
StringBuilder result =null;
if(JAVA5){
result = new StringBuilder(1000);
}else{
result = new StringBuffer(1000);
}
for(int[] i : matrix){
for(int j : i){
result.append(j);
}
result.append('\n');
}
Main Topics
Browse All Topics





by: SaMuElPosted on 2005-02-05 at 13:52:12ID: 13235787
Oh, and before anyone says it, I know the for each loop doesn't exist prior to Java 5, and I realise my toString method isn't returning anything. However, that's not the point.