Paste Search Dynamic
stack
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class main
  9. {
  10.         public static void main (string[] args) throws java.lang.exception
  11.         {
  12.                 int[] stack={10,20,30};
  13.                 int size=3;
  14.                 int idx=0;
  15.                 do{
  16.                         idx++;
  17.                 }while(idx>=size);
  18.  
  19.                 system.out.println(stack[idx]);
  20.         }
  21. }
Parsed in 0.006 seconds