Java | Language Basics | Convert | Convert string to int | Free Code Snippets
Code:
/** This code snippet was taken from freecodesnippets.com*/
public class ConvertStringToInt {
public static void main(String[] args) {
String aString = "78";
int aInt = Integer.parseInt(aString);
System.out.println(aInt);
}
}
Int to String originally posted here:
Java | Language Basics | Convert | Convert int to string | Free Code Snippets
/** This code snippet was taken from freecodesnippets.com*/
public class ConvertIntToString {
public static void main(String[] args) {
int aInt = 1;
String aString = Integer.toString(aInt);
}
}


Sign In
Create Account


Back to top









