Here is my code:
public class StackStudy{
public static void main(String[] args){
Stack<String> st = new Stack<String>();
st.push("hi");
st.push("bye");
st.push("awful");
System.out.println(st.toString());
}
}
and console prints out this:
[hi, bye, awful]
I thought using toString will get rid of the [], why is it still there?
EDIT: If toString is not the proper way to get rid of[], what is the right way to do it?