Online Java Compiler By
JavaTpoint.com
public class IntegerValueOfExample2 { @SuppressWarnings("static-access") public static void main(String[] args) { Integer i = 10; String str1 = "355"; String str2 = "-355"; // It will return a Integer instance representing the specified string System.out.println("Output Value = " + i.valueOf(str1)); System.out.println("Output Value = " + i.valueOf(str2)); } }
Output