How to convert string to int in java?

Answer Posted / hrindows@gmail.com

"class Scratch{
public static void main(String[] args){
String str = ""50"";
System.out.println( Integer.parseInt( str )); // Integer.parseInt()
}
}"

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you dynamically allocate memory to an array?

785


What are the six ways to use this keyword?

820


What are recursive functions?

796


Why do we create threads in java?

791


How do you escape sequences in java?

803


What is a JAR file?

785


Does java allow default arguments?

771


Can we override constructor in java?

799


What is difference in between java class and bean?

784


Are arrays passed by reference in java?

682


Is java type safe?

737


What do you mean by JVM?

786


What is the symbol for average?

708


How will you get the platform dependent values like line separator, path separator, etc., ?

785


What is the maximum size of list in java?

720