aspose file tools*
The moose likes Beginning Java and the fly likes Using Data Structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using Data Structure" Watch "Using Data Structure" New topic
Author

Using Data Structure

Ghazala Islam
Ranch Hand

Joined: Nov 22, 2000
Posts: 73
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

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!


[Jess in Action][AskingGoodQuestions]
 
 
subject: Using Data Structure