Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

997766Jun 19 2013 — edited Jun 19 2013

Hi,

I want to convert input field into integer

   int no;

no = Integer.parseInt(this.usernameField.getValue().toString());

I am getting the following error :-

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

Regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2013
Added on Jun 19 2013
1 comment
323 views