
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert Byte Primitive Type to Byte Object in Java
To convert byte primitive type to Byte object, use the Byte constructor.
Here is our byte primitive type.
byte b = 100;
Now let us convert it to Byte object.
Byte res = new Byte(b);
Let us see the complete example.
Example
public class Demo { public static void main(String[] args) { byte b = 100; Byte res = new Byte(b); System.out.println(res); } }
Output
100
Advertisements