Java OCA OCP Practice Question 829

Question

What will the following program print?

public class Main{ 
  public static void main (String [] args){ 
    unsigned byte b = 0; 
    b--; 
    System .out.println (b); 
   } 
} 

Select 1 option

  • A. 0
  • B. - 1
  • C. 255
  • D. - 128
  • E. It will not compile.


Correct Option is  : E

Note

There no unsigned keyword in java! A char can be used as an unsigned integer.




PreviousNext

Related