Java.lang.Byte.toString() 方法


Java.lang.Byte.toString() 方法

package com.codingdict;



import java.lang.*;



public class ByteDemo {



   public static void main(String[] args) {



      // create a byte primitive bt and asign value

      byte bt = 20;



      // create a String s

      String s;



      /**

       *  static method is called using class name. Assign 

       *  string representation of bt to s

       */

      s = Byte.toString(bt);



      String str = "String representation of byte primitive " +bt+ " is " +s;



      // print s value

      System.out.println( str );

   }

}