Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SortedList implements Serializable

Status
Not open for further replies.

Cosmicus

Programmer
Joined
Apr 14, 1999
Messages
2
Location
CA
I am using JDK 1.2 on IBM comp. machine for this project.<br>
<br>
The project is to create a sorted list from a bunch of instances of a class called Student. Student consists of Student_number, and student name. Another class called SortedList has a method "insert", which does the sorting.<br>
<br>
eg. of bunch<br>
//this is in the test.java class<br>
SortedList s = new SortedList();<br>
s.insert(7, new Student(7, "Jack"));<br>
s.insert(1, new Student(1, "Helen"));<br>
s.insert(9, new Student(9, "Moris"));<br>
s.insert(3, new Student(3, "Buddy"));<br>
<br>
//SortedList class has method "insert", which contains the<br>
//following arguments:<br>
public void insert(long key, Object stu)<br>
<br>
//the interface Sortable is implemented in the Student class<br>
interface Sortable {<br>
boolean compare(Object current, Object next);<br>
}<br>
<br>
//Now, <br>
class Student implements Serializable, Sortable<br>
//and<br>
class SortedList extends SLList implements Serializable {<br>
//SLList = Singly-Linked List (non-circular)<br>
<br>
The question is why do I get this compilation message:<br>
"Interface Serializable of class SLList not found.", when SLList is<br>
also implemented with the interface Serializable?<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top