Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Clifton Flores   on Jan 28 In Java Category.

  
Question Answered By: Fabiola Ferrrari   on Jan 28

Are you casting to int or Integer?

you cannot cast  to an int, as it is a primitive and
not a subclass of Object.

If you want to save the value as an int, use the
following:
((Integer)(s.getValue())).intValue();

Share: 

 

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

 
Didn't find what you were looking for? Find more on Object to Integer Or get search suggestion and latest updates.


Tagged: