2:22 am - Friday April 19, 2019

Long Example Program for valueOf(String s,int radix)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
@author: candidjava
@description:  valueOf(String s,int radix) is return a Long object holding the value represented by the string argument in the specified radix.
*/
public class DeeValueOfStringRadixLong
{
public static void main(String[] args) throws Exception
{
try{
String s="candid";//get the string
System.out.println(Long.valueOf(s,10));//to return a Long object holding the value represented by the string argument in the specified radix.
}
catch(Exception e)//if any exception occurs means catch exception
{
System.out.println(e.getMessage());//print exception message
}
}
}

output:
For input string: “candid”

Filed in: Z-A All Java Codes

Comments are closed.