Hi guys,
Sorry to put you all on the spot like this, but does anyone know what the primitive methods in a stack (in java) are ? . oo ya and also what methods a complete stack should contain ?
Any help would be great.
Thanks
Printable View
Hi guys,
Sorry to put you all on the spot like this, but does anyone know what the primitive methods in a stack (in java) are ? . oo ya and also what methods a complete stack should contain ?
Any help would be great.
Thanks
Google usually helps
If you make a class that accepts object's as a parameter for its methods it should be able to handle all primitive types (in wrapper form).
Push (obj)
Pop (obj)
PeekTop (obj)
isEmpty (boolean)
clear (void)
size (int)
and you could use arrays or arraylists to implement those functions
hope that helped a bit ;)
Hey,
Try out the java section of pscode.com... Just put "stack" (or whatever you want) into the search box at the top. PScode (Planet Source Code) has A LOT of code!! I did the search and it looks like there may be some stuff there that will help you.
Good luck
mjk