English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Per convertire il tipo originale di byte in un oggetto Byte, utilizzare il costruttore Byte.
Questo è il nostro tipo originale di byte.
byte b = 100;
Ora convertiamolo in un oggetto Byte.
Byte res = new Byte(b);
Lasciate che vediamo un esempio completo.
public class Demo { public static void main(String[] args) { byte b = 100; Byte res = new Byte(b); System.out.println(res); } }
Risultato di output
100