The Artima Developer Community
Sponsored Link

Java Answers Forum
Help quickly please - should be simple

1 reply on 1 page. Most recent reply: Mar 19, 2003 6:02 PM by rome

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
rome

Posts: 2
Nickname: rommal
Registered: Mar, 2003

Help quickly please - should be simple Posted: Mar 19, 2003 5:58 PM
Reply to this message Reply
Advertisement
ok i am trying this double looped method but can't get the body of the second loop to work at the moment, it just wont swap the two

ok, i have an




Appointment class

AppointmentList

Person

PersonList

Menu



any ideas, nothing too complicated as she will sus that kind of thing but anything within my limitations, please just tell me what i am doing wrong at the moment


public void sortByDate()
{
Outside:
for (int i = 0; i < theList.getNextFreeLocation(); i++)
{
Appointment temp = new Appointment("", "", "", 3, "");

Inside:
for (int j = 0; j <theList.getNextFreeLocation(); j++)
{
if((theList.getAppointment(i).getDate().compareTo(theList.getAppointment(j).get Date())) > 0)
{
temp = theList.getAppointment(i);
theList.getAppointment(i) = theList.getAppointment(j);
theList.getAppointment(j) = temp;
}

else
{
if ((theList.getAppointment(i).getDate().compareTo(theList.getAppointment(j).getDa te())) < 0)
{
continue Inside;
}
}



}
}
}


rome

Posts: 2
Nickname: rommal
Registered: Mar, 2003

Re: Help quickly please - should be simple Posted: Mar 19, 2003 6:02 PM
Reply to this message Reply
C:\Documents and Settings\Rozhan\Desktop\project\Diary>javac *.java
Menu.java:308: unexpected type
required: variable
found : value
theList.getAppointment(i) = theList
.getAppointment(j);
^
Menu.java:309: unexpected type
required: variable
found : value
theList.getAppointment(j) = temp;
^
2 errors

Flat View: This topic has 1 reply on 1 page
Topic: using Runtime class on Windows platform Previous Topic   Next Topic Topic: Java 1.4 printing HTML docs

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use