- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to convert byte to string
In Java, there are different ways to convert byte to string.
Using toString() method, you can easily convert byte to string as shown below −
Example
public class Demo { public static void main(String[] args) { byte res = 87; // byte to string System.out.println(Byte.toString(res)); } }
Output
87
In the above example, we have taken a byte value.
byte res = 87;
With that, to convert to string, the method toString() is used as shown below −
Byte.toString(res);
Let us see another example to convert byte to string.
Example
public class Demo { public static void main(String[] args) { byte val = 77; System.out.println(new String(new byte[] {val})); } }
Output
M
- Related Articles
- Java Program to convert string to byte
- Java Program to convert byte[] array to String
- Java Program to convert String to byte array
- Convert byte to String in Java
- Golang Program to Convert String Value to Byte Value
- Convert byte Array to Hex String in Java
- Convert Hex String to byte Array in Java
- How to convert hex string to byte Array in Java?
- Convert a String to a byte number in Java
- Java program to convert Byte array to IP Address
- Java Program to convert an UNSIGNED byte to a JAVA type
- How to convert a byte array to hex string in Java?
- How to convert a byte array to a hex string in Java?
- Convert byte primitive type to Byte object in Java
- How to convert byte array to string in C#?

Advertisements