About 5,750 results
Open links in new tab
  1. Integer (Java Platform SE 8 ) - Oracle

    An object of type Integer contains a single field whose type is int. In addition, this class provides several methods for converting an int to a String and a String to an int, as well as other constants and …

  2. Integer.valueOf () vs Integer.parseInt () with Examples

    Jul 11, 2025 · Integer.parseInt (): While operating upon strings, there are times when we need to convert a number represented as a string into an integer type. The method generally used to convert String …

  3. How do I convert a String to an int in Java? - Stack Overflow

    For example, here are two ways: // or int y = Integer.parseInt(str); There is a slight difference between these methods: The same is for all cases: Short.valueOf / parseShort, Long.valueOf / parseLong, …

  4. Java - parseInt () Method - Online Tutorials Library

    parseInt (int i) − This returns an integer, given a string representation of decimal, binary, octal, or hexadecimal (radix equals 10, 2, 8, or 16 respectively) numbers as input.

  5. Java - Integer parseInt () Method: A Comprehensive Guide

    The Integer.parseInt() method in Java provides a straightforward way to achieve this. This blog post will dive deep into the Integer.parseInt() method, covering its fundamental concepts, how to use it, …

  6. Java Integer parseInt () Method

    The Integer.parseInt () method is a static method in the Integer class in Java. It converts a string representation of a number to an int primitive.

  7. Integer (Java SE 21 & JDK 21) - Oracle

    The argument is interpreted as representing a signed decimal integer, exactly as if the argument were given to the parseInt(java.lang.String) method. The result is an Integer object that represents the …

  8. String to int in Java - GeeksforGeeks

    Jul 23, 2025 · The most common method to convert a string to a primitive int is Integer.parseInt (). It throws a NumberFormatException if the string contains non-numeric characters. The Integer.valueOf …

  9. How to Properly Encapsulate Integer.parseInt() in Java for Cleaner ...

    Nov 29, 2025 · Java developers frequently need to convert strings to integers, and Integer.parseInt(String s) is the go-to method for this task. However, this method throws a …

  10. Integer.parseInt() method in Java with Examples - Codekru

    The parseInt () is a static method of the Integer class and in this post, we are going to discuss the parseInt () method in detail with examples.