Skip to content

Instantly share code, notes, and snippets.

@eienf
Created May 16, 2013 15:47
Show Gist options
  • Save eienf/5592714 to your computer and use it in GitHub Desktop.
Save eienf/5592714 to your computer and use it in GitHub Desktop.
class Convert2 {
public static void main(String args[]) {
if ( args.length < 2 ) {
throw new IllegalArgumentException("parameter : number_string radix");
}
String s = args[0];
int radix = Integer.parseInt(args[1]);
int decimal = Integer.parseInt(s,radix);
System.out.println("result = "+decimal);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment