title: integers with octal and hexadecimal values and their operations
body: <p>I am beginner in java, I came up with a doubt in java which I would like to clarify.</p>
  
  <p>we can initialize a integer variable with a hexadecimal or octal values, but when we display the values (with hexa or octal) on the screen, it is displayed in decimal values. how can we make the output to be displayed in octal or hexadecimal?</p>
  
  <pre><code>public static void main(String[] args) {
          int a, b;
          a = 0xA1;
          b = 07;
          System.out.println("a = " + a);
          System.out.println("b = " + b);
          System.out.println("a + b = " + (a + b));
  }
  </code></pre>
  
  <p>What I am expecting is when I display the value in variable a it should display its assigned octal value 0XA1
  please help me out
  Output : </p>
  
  <pre><code>a = 161
  b = 7
  a + b = 168
  </code></pre>
  
  <p>also please explain me how the addition between two integer numbers of different bases(between a octal and hexadecimal) would take place, would there be any conversion between bases, and what would the base of the number resulting from the addition of two integers of different bases?</p>