Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Data Structure

 
Ghazala Islam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am instantiating List,Stack,Bag classes in my programe,but its giving error 'cannot resolve symbol' on these lines.I think i need to import any package or implement any interface,so if any of these is required please guide!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there are no "Bag" classes in the standard Java APIs, and List is an interface, which you can't instantiate. Stack is a concrete class, though. It (along with all the other Collections classes) is in the java.util package, so "import java.util.Stack;" would let you create one in your program. Read the javadocs for the classes in that package -- there are lots of interesting ones!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic