Notes: 1  Gain on disposal of investments and interest income are not considered as revenue because they are not earned from the principal business activity of ABC PLC, i.e. selling stationery goods.
To assign values to the various positions in an array, you do it in the normal way: aryNums[0] = 10; Here, a value of 10 is being assigned to position 0 in the array called aryNums. Again, the square brackets are used to refer to each position.
Java ArrayList Example 2: How to add element into ArrayList. You can add elements into ArrayList by calling add() method. Since we are using Generics and this is an ArrayList of String, second line will result in compilation error because this Java ArrayList will only allow String elements.ava ArrayList Example 1: How to create an ArrayList. You can use ArrayList in Java with or without Generics both are permitted by generics version is recommended because of enhanced type-safety. In this example we will create an ArrayList of String in Java.