Quote (NamelessPrince @ Apr 11 2013 11:36pm)
Dude Puzzle<T> can be anything, Clock extends Puzzle<Integers> that means all data types of T get replaced with Integers.
Clock extends Puzzle<Integer>
Water extends Puzzle<ArrayList<Integer>>
Get it now?
you misunderstood. i am well aware of what java generics are. i do not understand why your goals require generics. your code is full of contradictions and holes.
For example, your Puzzle class is using getStart generically but getStart isn't even defined so i know Puzzle isn't even compiling.
Then your Clock defined getStart but it is not generic.
Then your Solver class calls getStart from Puzzle (which doesn't exist) and gets back a T return value. but you dont actually use this value. ergo you do not need this based on your code so far.
Puzzle has a solve() method, but it doesn't return anything. what do you expect it to do?
if Puzzle has a solve() method, why is Solver calling getStart() instead of solve()?
So for now, i need you to ignore Clock and just show me the completed (pseudo)code for Puzzle and Solver so i can understand why you need T.
nobody can help you until you give sample code explaining what you're trying to accomplish, and that's done via Puzzle and Solver classes.