About 5,830 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

    Sadly, the standard Java methods Integer::parseInt and Integer::valueOf throw a NumberFormatException to signal this special case. Thus, you have to use exceptions for flow …

  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.

  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. parseInt in Java | Syntax, Parameters & Use Cases - upGrad

    This tutorial explains what Integer.parseInt () in Java does, how it works, and where it’s used. You’ll learn its method signature, accepted parameters, and what values it returns.