Changes between Version 15 and Version 16 of ControlSystems/SoftwareTeam/Training/GettingStarted/JavaExercises


Ignore:
Timestamp:
Nov 15, 2016, 10:16:05 PM (9 years ago)
Author:
azhang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/JavaExercises

    v15 v16  
     1This is a list of exercises that will start simple and begin to get more and more advanced. As the exercises get more advanced, the amount of hints and information given will decrease, allowing for more freedom and independence while programming.
     2* As the exercises get harder you will most likely have to start searching up information you don't know
     3* Searching up information you don't know is just a part of programming
     4  * If you still don't understand after searching something up, feel free to ask one of the leads or deputies, or even the people around you. We're always glad to help.
     5* Please do not feel pressured to complete all these exercises
     6  * Focus on fully understanding all the exercises you complete instead of trying to cover all the information
     7  * Feel free to mess around with the code to see what changes
     8
    19http://www.ntu.edu.sg/home/ehchua/programming/java/j2a_basicsexercises.html
    210
     
    8997* `Animal` has a `static int` called `population`, which starts at `0` and increases by `1` every time an animal is created
    9098* `Animal` has a `static getPopulation` method which returns the total number of animals created
     99* When two Animals `meet`, the more massive one eats the one with less mass. This should be a `static` method in `Animal`
     100
     101== Animal Farm step 6: Interfaces
     102* Create an `interface` called `Building`
     103* A building must be able to `collapse`
     104* A building must be able to `store` an object
     105
     106== Animal Farm step 6: Lists, Generics
     107* A `Farm implements Building`
     108* A `Farm` has a `List` of `Animal`
     109  * Research `Java Generics` to find out how to create a `List` of `Animal`, and to find out what generics do
     110  * Use either an `ArrayList` or `LinkedList`, but keep the type generalized as `List`
     111* A `Farm` has an `address`
     112* A `Farm` has a `Color` that can be `RED`, `BROWN`, `WHITE`, `BLUE`, or `GREEN`
     113* When a `Farm` `collapse`, it's `List` of `Animal` is cleared.
     114  * Warning: Clearing a List is not the same as setting it to null.