java tutorial - Java valueOf() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java numbers value of - Java examples - Java programs
Description
- The valueOf () method - returns the corresponding numeric object containing the value of the passed argument, in simple words - converts it to the desired data type.
- The argument can be converted to int, double, float and other data types, for example, you can convert a string to a number. li>
- The valueOf () method in Java is a static method. A method can take two arguments, where one is a string and another number system.
Syntax
All variants of the method are given below:
Options
Detailed information about the parameters:
- i - int, for which the integer representation will be returned.
- s - String for which the integer representation will be returned.
- radix - can be used to decide what integer value will be returned to based on the String passed.
Return value
- valueOf (int i): returns an integer object containing the value of the identified type.
- valueOf (String s): returns an Integer object containing the value of the identified string representation.
- valueOf (String s, int radix): returns an integer object taking an integer value of the identified string illustration, described with the value of the integer system.