July 2018
Intermediate to advanced
242 pages
8h 6m
English
As the result, our code is going to print the following text to the console:
Hi Agat, any plans for the evening?Great, I'll take some wine tooLet's go out of town and watch the stars tonight!Excelent!
In order to add elements of one collection to another, we are using the + operator. The standard library overloads this operator with the code responsible for merging elements of two Collection type instances collections into one instance. The sentMessages and inboxMessages variables are declared as List instances. The plus function returns a new Collection instance, containing elements of the sentMessages and inboxMessages lists. Finally, we use the forEach() function to iterate through the next elements of the list. In the ...
Read now
Unlock full access