Here you can find the source of toByte(Object obj)
Parameter | Description |
---|---|
obj | the object to be converted |
public static byte toByte(Object obj)
//package com.java2s; public class Main { /**/*from w ww . j ava 2s.co m*/ * Get the byte value of this object, only if the object is an instance of Number * * @param obj the object to be converted * @return the byte value of the object, or 0 if it is not a number. */ public static byte toByte(Object obj) { return (obj instanceof Number) ? ((Number) obj).byteValue() : 0; } }