Java Integer byteValue() Method Last Updated : 06 May, 2022 Comments Improve Suggest changes Like Article Like Report The byteValue() method of Integer class of java.lang package converts the given Integer into a byte after a narrowing primitive conversion and returns it (value of integer object as a byte). Also, remember this method does override byteValue() method of the Number class. The package view is as follows: --> java.lang Package --> Integer Class --> byteValue() Method Syntax : public byte byteValue() Return Type: Returns the numeric value represented by this object after conversion to byte type. Note: It is compatible with Java 1.5 and onwards. Example 1: Java // Java program to Illustrate byteValue() Method // Of Integer Class // Importing required class import java.lang.Integer; // Main Class class GFG { // Main driver method public static void main(String args[]) { // Creating an Integer object and // passing custom integer input Integer a = new Integer(34); // Converting integer number to byte value // using byteValue() method byte b = a.byteValue(); // Printing the corresponding byte value System.out.println(b); } } Output:34 Example 2: Java // Java Program to Illustrate byteValue() Method // of Integer Class // Importing required classes import java.lang.*; import java.util.*; // Main Class class GFG { // Main driver method public static void main(String[] args) { // Creating a Byte object Byte b = new Byte("01"); // Converting Byte to byte primitive // using byteValue() method Byte bp = b.byteValue(); // Display statement System.out.println("Byte object : " + b); // Primitive byte value of custom Byte passed above String str = "Primitive byte value of Byte object : " + bp; // Printing byte primitive value System.out.println(str); } } Output:Byte object : 1 Primitive byte value of Byte object : 1 Comment More info N Niraj_Pandey Follow Improve Article Tags : Java Java-lang package Java-Functions Java-Integer Explore Java BasicsIntroduction to Java4 min readJava Programming Basics9 min readJava Methods7 min readAccess Modifiers in Java5 min readArrays in Java7 min readJava Strings8 min readRegular Expressions in Java7 min readOOP & InterfacesClasses and Objects in Java10 min readAccess Modifiers in Java5 min readJava Constructors10 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages7 min readJava Interface11 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java6 min readIterator in Java5 min readJava Comparator Interface6 min readException HandlingJava Exception Handling8 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java10 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking15+ min readJDBC Tutorial5 min readJava Memory Management4 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz | Level Up Your Java Skills1 min readTop 50 Java Project Ideas For Beginners and Advanced [Update 2025]15+ min read Like