Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Print Byte Array in Java



You can simply iterate the byte array and print the byte using System.out.println() method.

Example

public class Tester {
   public static void main(String[] args) {
      byte[] a = { 1,2,3};
      for(int i=0; i< a.length ; i++) {
         System.out.print(a[i] +" ");
      }
   }
}

Output

1 2 3
Updated on: 2020-02-24T11:18:02+05:30

17K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements