hi, im currently learning stacks in java and have a quick question. what will the following code display if the stack is empty? my guess would be "true"?
System.out.println(st.isEmpty());
hi, im currently learning stacks in java and have a quick question. what will the following code display if the stack is empty? my guess would be "true"?
System.out.println(st.isEmpty());
Yes, it will print true
.
Running simple snippets of code is very easy (with IDEs like Eclipse - even easier), so you can verify all such assumptions with a few clicks/keystrokes.
In the future, give .jpage files a try. They provide a way in Eclipse to run small snippets of code as though they were being interpreted!