Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
76 views1 page

Tutorial - 3: Advanced Programming Language Concepts (CT006-3-3) Programming With Collection

To iterate through and display all elements of the array list [12,34,21,4,56,77,88,44,885,2,5,7,98,54], search and display the element 885, double each element and store in a new list, sort the lists in ascending and descending order, generate numbers from 2 to 20 by 2 and join to the list, display elements greater than 10, find the minimum and maximum values, sum and average, and check for even numbers, displaying true or false.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views1 page

Tutorial - 3: Advanced Programming Language Concepts (CT006-3-3) Programming With Collection

To iterate through and display all elements of the array list [12,34,21,4,56,77,88,44,885,2,5,7,98,54], search and display the element 885, double each element and store in a new list, sort the lists in ascending and descending order, generate numbers from 2 to 20 by 2 and join to the list, display elements greater than 10, find the minimum and maximum values, sum and average, and check for even numbers, displaying true or false.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Advanced Programming Language Concepts (CT006-3-3) Programming with Collection

Tutorial -3
Question:
Given an array list as follows. Write a Java/Javascript statement for the following requirements.
[12,34,21,4,56,77,88,44,885,2,5,7,98,54]
1. Iterate and display through all elements of array list.
2. Search and display an element, ie., 885.
3. Double up each array element by 2 and store them in another array list.
4. Sort all elements in ascending order.
5. Sort all elements in descending order.
6. Generate numbers from 2 to 20 with a gap of 2. Join this generated numbers with the
array list above. Display all elements of the newly created array list.
7. Find and display all the elements that is greater than 10.
8. Find the minimum and maximum value.
9. Find the sum and average value of the list.
10. Find any even number on the list. Display the result either true or false.

Level 3 Asia Pacific University of Technology and Innovation Page 1 of 1

You might also like