For this Question: Given a stack of integers and N queries. Your task is to perform these operations:-
<b>push:-</b>this operation will add an element to your current stack.
<b>pop:-</b>remove the element that is on top
<b>top:-</b>print the element which is currently on top of stack

<b>Note:-</b>if the stack is already empty then the pop operation will do nothing and 0 will be printed as a top element of the stack if it is empty.<b>User task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the functions:
 <b>push()</b>:- that takes the stack and the integer to be added as a parameter.
 <b>pop()</b>:-   that takes the stack as parameter.
 <b>top()</b> :-   that takes the stack as parameter.

<b>Constraints:</b>
1 &le; N &le; 10<sup>3</sup>You don't need to print anything else other than in <b>top</b> function in which you require to print the topmost element of your stack in a new line, if the stack is empty you just need to print 0.Input:
7
push 1
push 2 
top
pop
top
pop
top

Output:
2
1
0
, I have written this Solution Code:   
public static void push (Stack < Integer > st, int x) 
  {
    
st.push (x);
  
} 
 
    // Function to pop element from stack
  public static void pop (Stack < Integer > st) 
  {
    
if (st.isEmpty () == false)
      {
	
int x = st.pop ();
      
}
  
} 
 
    // Function to return top of stack
  public static void top(Stack < Integer > st) 
  {
    
int x = 0;
    
if (st.isEmpty () == false)
      {
	
x = st.peek ();
      
}
    
System.out.println (x);
  
}
  
 
, In this Programming Language: Java, Now tell me if this Code is compilable or not?