将数字转换为不同的基数后:
String thirteenAsBase36 = Long.toString(13, 36);
Run Code Online (Sandbox Code Playgroud)
如何将String转换回正常的10号基数?
Long thirteenAsBase10 = ?
Run Code Online (Sandbox Code Playgroud)
long parseLong(String s, int radix)
throws NumberFormatException
Run Code Online (Sandbox Code Playgroud)
http://download.oracle.com/javase/6/docs/api/java/lang/Long.html
Long thirteenAsBase10;
try
{
thirteenAsBase10 = Long.parseLong(thirteenAsBase36, 36);
}
catch ( NumberFormatException e )
{
System.out.println("Oops");
}
Run Code Online (Sandbox Code Playgroud)
你的第一个想法应该是:阅读JavaDocs.