How to Convert String to Integer Using Radix 27 in Java


In this example, let’s  see how to convert string to integer using radix 27.

Source Code

package com.beginner.examples;

public class StringToInteger {

	public static void main(String[] args) {
		//Create String Object.
		String str = "123456";
		
		/*
		 * By using Integer.parseInt() method 
		 * and passing radix value as 27, 
		 * convert string to integer value.
		 */
		Integer integer = Integer.parseInt(str,27);
		
		System.out.println("Integer value is : " + integer);

	}

}

Output:

Integer value is : 15473895
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments