wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Trouble with ADT lists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble with ADT lists" Watch "Trouble with ADT lists" New topic
Author

Trouble with ADT lists

Jarom Knudsen
Greenhorn

Joined: Oct 14, 2010
Posts: 3
I've been tinkering around seemingly all day at trying to figure this bit out. The assignment is to make a bag like ADT list. Then, make it so if I have two such lists, they can compare the entries in each other and make a third "bag" into which contents of equal or differing values can be placed. Anyways, I'm at the point marked with all the exclamation marks in AList.java. For some annoying (and certainly very noobish) reason, it keeps saying that the value to be returned is a String instead of a generic type object. I'm rather new to java and would like all the help I can get to figure this out! Thanks!

/*****************************************************************************************************

/****************************************************************************************************

/**********************************************************************
If you see anything else I'm doing wrong or think I should do instead, please tell me! Thank you again!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38005
    
  22
Style problems: That interface ought not to have its comments marked //, but they should be documentation comments with /** ... */
That isSame method does not return whether the two values are the same. If you are using objects, you should writeDon't use the compareTo method unless you are certain it is consistent with equals. Don't writeif (...) return true; else return false;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble with ADT lists
 
Similar Threads
ArrayList
Iterator Pattern
Using FileChannel instead of RandomAccessFile
Making a Structure out of a class
HashMap mapped property / action form