The basic things is to keep in correct place input/output value as string and the numerical value as number, which is one suitable format suitable for calculations.
So what really happens is that your have two processes input
'some numbers' -> value('some numbers')
value -> string representation of value in any desired base
Also you do not find function to directly translate string to input base7 number and output it in base 3, but you can read the value of base7 number and you can output the value of your variable in base7. It is two step process.
If you want to use base -2 probably you are out of luck in Java (which I know only superficially) as you are in Python (which I consider myself knowing reasonably well), and must roll out your own function.
Use Integer.valueOf(String s, int radix) to parse your input string with whatever base you want (radix = 2 for binary, 16 for hex etc). That gives you an int. Then use Integer.toString(int i, int radix) to covert that int to any other base. eg
int i = Integer.valueOf("1101", 2); // parse 1101 as binary
System.out.println( Integer.toString(i, 8)); // print it out in octal
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...