Here you can find the source of toByte(Number num)
Parameter | Description |
---|---|
num | A Number instance. |
public static Byte toByte(Number num)
//package com.java2s; /*//from w ww .j a v a2 s. co m * Copyright (c) 2015 NEC Corporation * All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html */ public class Main { /** * Convert the given number into a {@link Byte} instance. * * @param num A {@link Number} instance. * @return A {@link Byte} instance equivalent to the given number. * {@code null} if {@code num} is {@code null}. */ public static Byte toByte(Number num) { return (num == null) ? null : Byte.valueOf(num.byteValue()); } }