File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using Data Structure" Watch "Using Data Structure" New topic

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

Joined: Jul 08, 2003
Posts: 24187

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]
I agree. Here's the link:
subject: Using Data Structure