This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You know that the abws is a list and actually it is an object isn't it?
like arrays... lists are also objects in java
so when you just print the abws variable, it gives the hashcode of the object at which it is resting
you should not expect the list to output
when you print the array variable using System.out.println(abs);
then also you will get the same output
this is also because of the same reason that array is an object in java and printing it will print the hashcode
also you are getting the same output because whenever you modify the arrays or the lists using toArray or asList methods
then the changes are done directly in the original array or the list... the copy of the list is not created
hence the changes done int array or the list are reflected in both
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right