Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

parseInt(String) in type Integer not applicable arguments

parseInt(String) in type Integer not applicable arguments

 
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Thu Nov 27, 2008 9:19 am    Post subject: parseInt(String) in type Integer not applicable arguments Reply with quote

Hi

When i try to convert object to integer

Quote:
The method parseInt(String) in the type Integer is not applicable for the arguments (Object)


I get this error
Code:

Object obj = new Integer(5);

Integer.parseInt(obj)
Back to top
View user's profile Send private message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Thu Dec 04, 2008 9:28 am    Post subject: Reply with quote

Quote:
Type mismatch: cannot convert from Object to int


This is error on jsp page
Back to top
View user's profile Send private message
yovi



Joined: 19 Mar 2007
Posts: 3

PostPosted: Thu Dec 04, 2008 9:44 am    Post subject: Reply with quote

It is type cast problem

Cast it to wrapper classes again

Code:
Object obj = new Integer(5);

int va=(Integer)obj;


Instead of using parsing in Int

Quote:
Integer.parseInt(obj)


This is used for parsing string into int data type
Back to top
View user's profile Send private message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Thu Dec 04, 2008 9:46 am    Post subject: Reply with quote

After using casting object to Integer

Integer(object);

I am getting this error again

Quote:
java.lang.ClassCastException: com.sun.jmx.mbeanserver.JmxMBeanServer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack