aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 36453
    
  15
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;
 
 
subject: Trouble with ADT lists
 
Similar Threads
Iterator Pattern
HashMap mapped property / action form
Making a Structure out of a class
Using FileChannel instead of RandomAccessFile
ArrayList