No nonsense, first on the code:
New Arraylist<integer>(); System.out.println ("Initial size:" + col.size ()); for (int i = 0; i <; i++) + ten);
Obviously, the above code is simple enough to create a ArrayList of the Interger type parameter.
So consider removing two elements from ArrayList, such as 10, 25. The initial idea of the code is as follows:
Col.remove (ten); Col.remove (25);
The reason for this assumption is that since the type in arraylist<integer> is an Integer, I should be able to automatically implement the autoboxing when I pass in an int. Then, as you would imagine, 10 and 252 elements in Col are deleted.
The result of the actual operation is otherwise:
Exception in thread "main" java.lang.indexoutofboundsexception:index:25, size:20 at Java.util.ArrayList.rangeCheck (Arraylist.java:604) at Java.util.ArrayList.remove (Arraylist.java: 445) at Collectionbasics.main (Collectionbasics.java:54)
As you can see from the middle of the error, the Access array index is out of bounds. How could that be? Obviously, the incoming 10,25 is treated as an index and not as an element to remove. See the Java doc inside only found that there are two remove methods, respectively, defined as follows:
Public E Remove (int index); Public boolean remove (Object o);
When we pass in the int type, it is automatically called as the method above. And the next way to remove a particular element is to pass in a single Object object. Therefore, in order to remove the established elements without causing confusion, the incoming int can be encapsulated first:
Col.remove ((Integer)); Col.remove ((Integer)25);
So the result is right.
In Beijing for half a year, but also have their own experience.
First: Just start looking for a job, you can not put yourself too low, to have their own minimum bottom line, can not be said to pay casually, to have their own goals. Because the lower the starting point, the more difficult to crawl. Some of the company's HR do not like to casually see their own people. Therefore, the first job to have their own minimum, after the positive than the internship pay doubled 1.5 times times.
Second: Feel the need to raise wages when, on the proposed, do not hesitate, because the boss may have had this idea, but you did not mention, why the boss to give you rise. Put forward is necessary, regardless of failure and success, if failed, the boss will re-look at you as a person, feel that you are not happy with the current work situation.
Thirdly, to raise wages, the boss will generally ask, how much you want. So you have to have a salary and minimum wage in advance, if the boss listens to your expected salary, a promise, that's good; but if the boss bargained for a bargain, it can't be lower than your minimum wage. Because you do not expect the salary, only with the boss of your minimum wage, the boss agreed to listen to, you will regret that did not have much to do.
A small detail of list<integer>.remove ()