This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, Just checking out the possiblity if its possible? Seetesh
Joined: Feb 13, 2004
Hi, I was trying something like this String language = "english"; String country = "english"; int a = 100; int b= 100; Stack astack = new Stack(); astack.push(language); Stacks dont seem to take in int values. Any clues. Seetesh
No, they only hold Objects. In order to push ints or other built-in types onto a stack, you need to use the wrapper classes such as Integer. You should learn as much as you can about the wrapper classes. They are used quite frequently. I'm sure you can search the board for previous discussions about them. Layne