I am trying to convert a base 10 number to any base by using conversion. Right now this is the code I have came up with. I have a sad feeling this may be completely wrong. The
A quick way to do it in Java is this:
Integer.toString(int i,int radix);
For example,
Integer.toString(255,2)
would return "11111111". I'm not sure if you are just looking for a quick solution or do you actually want to implement the conversion method yourself. This would be a quick solution. Refer to this post: What is the method in the API for converting between bases?