ERROR ON PREV
...Problem Set 0
  1. "Hello, World!"
  2. Variables and Types
  3. Arrays
  4. While, If, For
  5. ...Problem Set 0
  6. Static Methods
  7. Static Fields
  8. String Conversion
  9. Objects
  10. Threading
  11. Strings
  12. ...Problem Set 1.5
  13. Packages
  14. Complex Numbers
  15. Abstract classes
  16. Interfaces
  17. Autoboxing
  18. ...Problem Set 1
  19. enum
  20. Inner Classes
  21. Polymorphism
  22. Tanks!
  23. Callbacks
  24. Exceptions
  25. File I/O
  26. ...Problem Set 2
  27. Regular Expressions

...Problem Set 0

  1. Write a loop that prints out the numbers 0 to 5
  2. Write a loop that prints out the numbers 1 to 4
  3. Write a loop that prints out the sequence 5, 10, 15, 20
  4. Write a loop that prints out the odd numbers between 4 and 96.
  5. Write a program to print numbers between 4 and 96 that are neither even, nor divisible by 3.
  6. Here's an example of a code that creates a copy of an array, with its elements reversed:
    Reverse.java
    1public class Reverse {
    2    static int[] reverse(int[] input) {
    3        final int n = input.length;
    4        int[] output = new int[n];
    5        for(int i=0;i<n;i++)
    6            output[i] = input[n-i-1];
    7        return output;
    8    }
    9    public static void main(String[] args) {
    10        int[] fvalues = new int[]{1,2,3,5,99};
    11        int[] rvalues = reverse(fvalues);
    12        for(int i=0;i<rvalues.length;i++)
    13            System.out.println(i+"] "+rvalues[i]);
    14    }
    15}
    $ javac Reverse.java
    
    $ java Reverse
    0] 99
    1] 5
    2] 3
    3] 2
    4] 1
    
    Using it as inspiration, write a method called "evens" that creates a copy of the array with the odd numbers removed.