When you perform the ParseInt operation with the radix, the 11 base 16 is parsed as 17, which is a simple value. It is then printed as radix 10.

You want:

System.out.println(Integer.toString(11, 16));

This takes the decimal value 11(not having a base at the moment, like having "eleven" watermelons(one more than the number of fingers a person has)) and prints it with radix 16, resulting in B.

When we take an int value it's stored as base 2 within the computer's physical memory (in nearly all cases) but this is irrelevant since the parse and tostring conversions work with an arbitrary radix (10 by default).

Answer from nanofarad on Stack Overflow
🌐
Tutorialspoint
tutorialspoint.com › java › lang › integer_parseint_radix.htm
Java Integer parseInt with Radix
The Java Integer parseInt(String s, int radix) method parses the string argument s as a signed integer in the radix specified by the second argument radix. Some examples can be seen here ?
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › lang › Integer.html
Integer (Java Platform SE 7 )
+ DecimalNumeral, HexDigits, and ... ("0x", "0X", "#", or leading zero) is parsed as by the Integer.parseInt method with the indicated radix (10, 16, or 8)....
🌐
Knowledgewalls
knowledgewalls.com › johnpeter › books › one-day-one-thing-to-know › how-to-use-integerparseintstringradix-in-java
How to use Integer.parseInt(String,Radix) in JAVA
Everyday one topic to go as master in Future. Book contains technical topics of computer software development. Such as MySQL, Core Java, HTML, CSS and JQuery and More.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Integer.html
Integer (Java Platform SE 8 )
October 20, 2025 - + DecimalNumeral, HexDigits, and ... ("0x", "0X", "#", or leading zero) is parsed as by the Integer.parseInt method with the indicated radix (10, 16, or 8)....
🌐
Scaler
scaler.com › home › topics › parseint() in java
parseInt() in Java - Scaler Topics
May 8, 2024 - Following is how the parseInt() method can be declared in java: Note : Radix is the parameter that specifies the number system to be used.
🌐
LabEx
labex.io › tutorials › java-java-integer-parseint-method-117728
Java parseInt(String, int) | Integer Parsing Tutorial | LabEx
Java parseInt(String s, int radix) method is used to parse a string value as a signed decimal Integer object in a specified integer radix value, which is part of the Integer class provided by the java.lang package.
Find elsewhere
🌐
Tutorialspoint
tutorialspoint.com › java › number_parseint.htm
Java - parseInt() Method
... 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.
🌐
BeginnersBook
beginnersbook.com › 2022 › 10 › java-integer-parseintmethod
Java Integer parseInt()Method
In the following example, we have a string that contains hex value, we can parse this hex value to int using radix 16. public class JavaExample { public static void main(String[] args) { String s1 = "100"; String s2 = "EF"; //hex value String s3 = "77"; //decimal: 77, octal: 63 int i1 = Integer.parseInt(s1, 10); //radix 10 for decimal int i2 = Integer.parseInt(s2, 16); //radix 16 for hex int i3 = Integer.parseInt(s3, 8); //radix 8 for octal System.out.println("int value: "+i1); System.out.println("int value: "+i2); System.out.println("int value: "+i3); } }
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › parseint in java
parseInt in Java: Everything You should Know | upGrad
June 25, 2025 - The parseInt(String s, int radix) method in Java allows you to parse a string representation of an integer with a specified radix (base).
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.lang.integer.parseint
Integer.ParseInt Method (Java.Lang) | Microsoft Learn
The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u005Cu002D') to indicate a negative value or an ASCII plus sign '+' ('\u005Cu002B') to indicate a positive value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the #parseInt(java.lang.String, int) method.
🌐
Bitget
bitget.com › crypto wiki › radix price › how does the radix and parse work in java
How Does the Radix and Parse Work in Java
This is useful when working with numbers in different formats or when you need to perform mathematical operations in a specific base. The syntax for the radix function is as follows: int number = Integer.parseInt("10", radix);
🌐
Javatpoint
javatpoint.com › java-integer-parseint-method
Java Integer parseInt() Method - Javatpoint
Java Integer parseInt() Method - The Java parseInt() method is a method of Integer class that belong to java.lang package. The parseInt() method in Java is crucial for converting string representations of numbers into actual integer values. This capability is fundamental in various programming ...
🌐
Global Tech Council
globaltechcouncil.org › home › what is parseint in java?
What is parseInt in Java? - Global Tech Council
July 5, 2025 - For example, if you use a radix of 2, the method will treat the string as a binary number. So parseInt(“101”, 2) will return the integer 5, because 101 is 5 in binary.
🌐
Study.com
study.com › courses › business courses › business 104: information systems and computer applications
How to Convert String to Int in Java - ParseInt Method - Lesson | Study.com
January 9, 2023 - It's important that the string value actually is numeric, or the code will fail. ParseInt() can accept a second parameter, called the radix, which will treat the first number as binary, octal, or hexadecimal.
🌐
Studytonight
studytonight.com › java-wrapper-class › java-integer-parseint-string-int-radix-method
Java Integer parseInt(String s, int radix) Method - Studytonight
import java.lang.Integer; public class StudyTonight { public static void main(String[] args) throws NumberFormatException { String s1 = "603"; String s2 = "-603"; int radix = 16; System.out.print("\nEntered value and Base value is: " + s1 + " and " + radix); //returns the signed Integer object of the entered string in accordance with the radix System.out.println("\nEquivalent Integer object is " + Integer.parseInt(s1, radix)); System.out.print("\nEntered value and Base value is: " + s2 + " and " + radix); //returns the signed Integer object of the entered string in accordance with the radix System.out.println("\nEquivalent Integer object is " + Integer.parseInt(s2, radix)); } }
🌐
Demmel
demmel.com › joc › help › JavaDocumentation › java › lang › Integer › parseInt.htm
Method java.lang.Integer.parseInt
The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002d') to indicate a negative value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(String, ...
🌐
Baeldung
baeldung.com › home › java › java numbers › difference between parseint() and valueof() in java
Difference Between parseInt() and valueOf() in Java | Baeldung
January 8, 2024 - By default, the parseInt() method assumes that the given String is a base-10 integer. Here, the parameter radix is the radix or base to be used for string to integer conversion.