Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Cesar Gonzalez   on Mar 01 In Java Category.

  
Question Answered By: Alvin Nguyen   on Mar 01

I dont know what you are trying to compare. If t1 and t2 are
instances of type  Double or Integer..etc, you can just use that
specific Wrapper class's compareTo() method.
If you really want to cast  that Object which is of type String to an
int, this is how:

public int  compareTo (Object t)
{
int temp  = Integer.parseInt ( String )t );
return temp;
}

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How Do I Cast Object To Int ? Or get search suggestion and latest updates.


Tagged: