Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
BeefofAges
Jun 5, 2004

Cry 'Havoc!', and let slip the cows of war.

I don't think you can have overloaded operators in Java.

Adbot
ADBOT LOVES YOU

BeefofAges
Jun 5, 2004

Cry 'Havoc!', and let slip the cows of war.

mistermojo posted:

ok, I have another problem with the same code: After search, my sortarray has a list of values. However, when I check right after search(args); in the main, it says sortarray is empty. I'm not sure why this is. Here's the code: http://www.2shared.com/file/3550150/fe98a50b/Sort.html

Your search method is returning a value, but you're not doing anything with it.

code:
}else {
	search(args);
	bubblesort(sortarray);
	lineprinter(sortarray);
}
should be
code:
}else {
	sortarray = search(args);
	bubblesort(sortarray);
	lineprinter(sortarray);
}
See the difference?

You'll probably also want to do something similar with bubblesort(), seeing as you've set it up to return the sorted array.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply