java.lang.Number.byteValue()


java.lang.Number.byteValue()

package com.codingdict;



public class NumberDemo {



   public static void main(String[] args) {



      // get a number as integer

      Integer x = new Integer(123456);



      // get a number as float

      Float y = new Float(9876f);



      // print their value as byte

      System.out.println("x as integer:" + x

         + ", x as byte:" + x.byteValue());

      System.out.println("y as float:" + y

         + ", y as byte:" + y.byteValue());

   }

}