src/share/classes/java/lang/Byte.java

Print this page

        

@@ -199,11 +199,11 @@
      * @throws          NumberFormatException If the {@code String} does
      *                  not contain a parsable {@code byte}.
      */
     public static Byte valueOf(String s, int radix)
         throws NumberFormatException {
-        return new Byte(parseByte(s, radix));
+        return valueOf(parseByte(s, radix));
     }
 
     /**
      * Returns a {@code Byte} object holding the value
      * given by the specified {@code String}. The argument is

@@ -275,11 +275,11 @@
     public static Byte decode(String nm) throws NumberFormatException {
         int i = Integer.decode(nm);
         if (i < MIN_VALUE || i > MAX_VALUE)
             throw new NumberFormatException(
                     "Value " + i + " out of range from input " + nm);
-        return (byte)i;
+        return valueOf((byte)i);
     }
 
     /**
      * The value of the {@code Byte}.
      *

@@ -372,11 +372,11 @@
      *
      * @return  a string representation of the value of this object in
      *          base&nbsp;10.
      */
     public String toString() {
-        return String.valueOf((int)value);
+        return Integer.toString((int)value);
     }
 
     /**
      * Returns a hash code for this {@code Byte}; equal to the result
      * of invoking {@code intValue()}.