Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mac Player

macrumors regular
Original poster
Jan 19, 2006
225
0
Hi,

Can i implement comparable in an abstract class? This way for example, i could sort of array of objects from different clsses extending the same abstract class. Or maybe not.....
 

Llywelyn

macrumors member
Oct 27, 2003
48
0
Hi,

Can i implement comparable in an abstract class? This way for example, i could sort of array of objects from different clsses extending the same abstract class. Or maybe not.....

I assume you mean in Java?

Yes. You can implement a Comparable abstract class. You can also implement a Comparable interface.
 

Mac Player

macrumors regular
Original poster
Jan 19, 2006
225
0
Thanks. Yes I was talking about java.

So i can do something like:

public abstract class xxx implements Comparable
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.