Tuesday, 11 March 2014

Tutorial 1 - Question 3

Create a class that is generic that has an 1 array with size of 20 in it and 1 porition variabable  .
create a generic add method that add any elements specified for the array to the last available item in the array . if the array is currently full , you have to remove the first element and push the remaining element up and add the new element at the last position.

Create a remove method that remove the last item by nullified/vacant that particular array position.

Create a print method that print all the element


No comments:

Post a Comment