2572
Sorry for not being clear.The 'global' variable i was referring to was 'max'. If you see the output snapshot, when i call the Push() method, max's value gets changed to zero, even though i...
Type: Posts; User: Kartik V
2572
Sorry for not being clear.The 'global' variable i was referring to was 'max'. If you see the output snapshot, when i call the Push() method, max's value gets changed to zero, even though i...
how do i make it final? i have to accept the max value in the main method, and after doing dat how shall i make it final? Btw, can u tell me why does the global variable's value change in the other...
Well,
this is a stack as an array program.When i call the push function for the first time, the 'max' value gets changed to zero, even though its a global variable, and i accept its value from the...
import java.io.*;
public class StackImplementation
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int max;
int top;
int stack[];
public...