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());
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.