title: How would you find out if a machine’s stack grows up or down in memory? (JAVA)
body: <p>I have a C program to check whether the machine stack is growing up or down in memory in.</p>
  
  <p>It goes like that :</p>
  
  <pre><code>#include &lt;stdio .h&gt;
  
  void sub(int *a) {
   int b;
  
   if (&amp;b &gt; a) {
      printf("Stack grows up.");
   } else {
      printf("Stack grows down.");
   }
  }
  
  main () {
   int a;
   sub(&amp;a);
  }
  </code></pre>
  
  <p>Now i want to do the same in Java. :-)</p>
  
  <p>Any one knows a solution without writing any native code ??? </p>
  
  <p>Thanks</p>