Usages of the Integer wrapper class :-
This class provides constants and methods that are useful while working with int(s).
For example it has a method Integer.parseInt(String s, int radix) which can be used to convert a string value representing a binary, octal, hex or a decimal integer within the valid range of a Integer
int x = Integer.parseInt("B", 16);
//parses the string literal "B" using base-16 and returns decimal 11 as a int
int y = Integer.parseInt("747");
//parses the string literal "747" using base-10 and returns decimal 747 as an int//Note that we need not pass the radix when we want to convert to decimal (or base-10)
In the below code, the main method of CalculateDifference will be passed two arguments.
Both the values can be any number between Integer.MIN_VALUE to Integer.MAX_VALUE.
Complete the below code so that it produces the correct output.
Note: You can assume that the first string value passed in
[Hint: You can convert arg[0] to
0 Comments