Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

jcie ching

Greenhorn
+ Follow
since Feb 08, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jcie ching

hi i think i found the error but now im getting "illegal start of expression"
near "public int compareTo(Object o)" and "public boolean equals(Object o)"


any suggestions?
[ February 08, 2006: Message edited by: jcie ching ]
[ February 09, 2006: Message edited by: jcie ching ]
12 years ago
thanks for your reply, i followed what u said and still some errors:



the error im getting is "class/interface expected"..
im just really new in java hope u dont mind =)
any more suggestions? thanks
12 years ago
Hi thanks for your reply, i got to fix the error already but on the second part of the program where my most errors and confusion is going on..please help
I need to write a program that that reads in a student record from a file.
I need to use method compareTo that compares two student records. Only the names of the students should be compared. The last name is more significant than the first one. The methid should return -1 if the first name is less than the second name, 0 if they are equal, and 1 if the first name is greater than the second one. A method equals that compares two students. Again only the names should be compared (as it is in the compareTo method.)

here what i got so far:



the error im getting are
invonvertible types - what does it mean?
thanks
12 years ago
I need to do a program that determines whether a file of student records is in sorted order or not. This program should consist of two classes.
In the first class it should contain a main method that prompts the user for the name of the input file.If the file cannot be opened, it should continue to reprompt the user for the correct name, until the file can be opened. The file should be read and the program should verify that the file is in ascending order. If it is not, an appropriate error message should be displayed and the program should terminate. As the student records are read in they should be displayed on the screen.I only doing first class because im already getting an error, i wanted to to thid first before i move on to the secomd class method.

I admit this is a project but i need some guidance please..
here is the code that i just did:



Im getting an error : illegal start of expression

sorry im new to java, really trying to understand it..
please help .. thanks
[ February 08, 2006: Message edited by: jcie ching ]
12 years ago