00:01
So here we are asked to perform a task where we take a list and create a function that calculates the sum and returns it to the user.
00:13
So firstly, i should note i have two classes here.
00:16
My main class, which is actually doing the execution with the example, and the my list class, which is operating as a container class.
00:25
This is a good example on how you would build out a container -like class.
00:30
If you wanted to contain other objects.
00:33
This just keeps it simple with the generic integer types.
00:37
So firstly, in my class we have the public class, my list declaration, then we have one private entity known as numbers.
00:47
That is going to be a list integer type, but it's declared as a new array list type in order to satisfy the constraint.
00:59
Satisfy the constraint that we have to keep it a list.
01:02
When you're making a declaration of a list type, it usually throws a null pointer exception if you don't, this is within java, it throws a null pointer exception type if you just try and keep it list integer numbers.
01:18
Here we have our default constructor...