How to set value to Byte object in Java

3 Answers

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {
       
        byte b = 127;
        
        Byte bObj = b;
        System.out.println(bObj);
    }
}
   
/*
      
run:
      
127
  
*/

 



answered Nov 8, 2016 by avibootz
0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        Byte bObj = 127;
        System.out.println(bObj);
    }
}
   
/*
      
run:
      
127
  
*/

 



answered Nov 8, 2016 by avibootz
0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        Byte bObj = new Byte("127");
        System.out.println(bObj);
    }
}
   
/*
      
run:
      
127
  
*/

 



answered Nov 8, 2016 by avibootz

Related questions

1 answer 180 views
3 answers 267 views
4 answers 329 views
329 views asked Nov 8, 2016 by avibootz
4 answers 321 views
321 views asked Nov 8, 2016 by avibootz
3 answers 251 views
...