You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ArrayMethod.java 693B

123456789101112131415161718192021222324252627
  1. import org.aspectj.testing.*;
  2. public class ArrayMethod {
  3. public static void main(String[] args) {
  4. new ArrayMethod().go();
  5. Tester.check(true, "compiled");
  6. }
  7. void go() {
  8. try {
  9. int[] array1 = array1();
  10. int[] array2 = array2();
  11. for (int i = 0; i < array1.length; i++) {
  12. Tester.checkEqual(array1[i],i);
  13. Tester.checkEqual(array2[i],i);
  14. }
  15. } catch (Exception e) {
  16. }
  17. }
  18. int array1()[] throws Exception {
  19. return new int[] {0,1,2};
  20. }
  21. int[] array2() throws Exception {
  22. return new int[] {0,1,2};
  23. }
  24. }