Originally Posted by
eternity007
I have written a code. A part of which will do a decimal to octal transformation.
The function will take an Integer and convert it to corresponding octal number but return the result as String and not as number.
Can any one point out what could the potential problem in this program???
What I want to know, if this logic works??? or it may crash in some scenario??
Thanks in advance.
Hello eternity007!
You can use the
Integer.toOctalString(int) method to accomplish your requirements , or at least test your code with it (btw I tested it and it seems to work properly).