Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tough time w/ class program

 
John Scuro
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all ~ I am in need of some assistance with a class program. The problem is that I do not know where the problem exists. I have implemented a comparable interface and have set some fields as to the program requirements. I was given code to a class called Sorting, that will sort any item that implements my comparable interface; I believe the most practical way for me to receive some assistance is through e-mail. I can send the program and the program requirements --in hopes of receiving some explanation to what the problem might be. I could post code, but it is rather lengthy and like I said: I not sure where the problems exist.

Any help would be greatly appriciated!!!

--I just want to get this thing working properly and "understand" where my mistakes have been.

Thanks for your time
 
Henry Wong
author
Marshal
Pie
Posts: 21114
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[John Scuro:]   I am in need of some assistance with a class program. The problem is that I do not know where the problem exists. I have implemented a comparable interface and have set some fields as to the program requirements.

What problem ?

[John Scuro:]   I was given code to a class called Sorting, that will sort any item that implements my comparable interface. I could post code, but it is rather lengthy and like I said: I not sure where the problems exist.

Post the code, be SURE to use the code tags. I have tested the waters, it is your thread of discussion and the ONLY time I have ever seen anybody say anything about an overly large code post was when someone pasted several hundred lines of what amounted to the entire dataset and could have been inferred from the first and last ten lines. Don't post the code that you were given: post the code that you try to write.

[John Scuro:]   ...fields as to the program requirements.

What fields, what requirements ?

I just want to get this thing working properly and "understand" where my mistakes have been.

Okay, but we don't do homework.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Scuro:
... The problem is that I do not know where the problem exists...

Welcome to JavaRanch!

How do you know there is a problem? What are the error messages? What is it failing to do? Or what is it doing that it shouldn't be?

My guess is that there might be a problem in the way you implemented Comparable. If that's the case, maybe that's the only code we need to see. (As Nicholas suggested, please use Code Tags when posting code.)
[ November 25, 2007: Message edited by: marc weber ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic