| Author |
stacks
|
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
|
|
in my book they created a stack object like so.. Stack word = new Stack(); and they pushed and poped characters. because the book didn't say that the Stack was a char Stack. so you can push or pop any value in a stack? and it doesn't matter? so i could say char A = a; String string = hello; word.push (A); word.push (3); word.push (string); and i wouldn't get an error? please clarify... thanks -Justin-
|
You down with OOP? Yeah you know me!
|
 |
Rusty Shackleford
Ranch Hand
Joined: Jan 03, 2006
Posts: 490
|
|
It shouldn't allow it, try and compile and run it. Stack is not a stand alone data structure, it could be build on an array, linked list and in the case of Stack in the API it is built using Vector.
|
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
|
 |
 |
|
|
subject: stacks
|
|
|