NumberFormatException : What is the problem in my java code?




Asked on February 09, 2015
public class MyLength {
public static void main(String[] args) {
String s= "THANKSGOD";
int i= Integer.parseInt(s);
}

}




Replied on February 09, 2015
would you please explain about your java code, what you want to do with it?





Replied on February 09, 2015
I want to count the length of my string...


Replied on February 09, 2015
Here NumberFormatException occur because you have a string variable and converting this variable into digit will occur NumberFormatException. 

Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us