i. Before going through below exercises please visit the link
given below, where you can experience the coding standard that each and every developer should follow. ii. This Code Conventions for the Java Programming Language document contains the standard conventions that Sun follow and recommend that we should follow. It covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices and includes a code example. iii. You also can find a .pdf doc on the Code Conventions in server i.e. in /server/javautilities/ codeconventions.pdf.
Time duration: 2hrs
COLLECTIONS LAB EXERCISE DAY-1
1. Create one collection which will store runs of different
batsmen .Now calculate the total run scored by the team .Use different techniques(at least 2) to access the element of your collection. 2. Write a program for a gas agency, where customers are standing in a queue for getting the cylinder. First we need to save all customers name and then when we save all names of that queue. We need to give cylinder to them in the order they are standing in queue. While distributing cylinder show their names just to observe the order in which customers are getting cylinder. Suppose instead of customer name we are storing customer Id which is there in their gas book, Modify the above program for this current requirement? 3. Create one collection which store marks of 10 student, and arrange them in ascending by using predefine API methods. Try to add the name of one student also, is it possible? How you can write your program so that it will take marks only.
Services. All rights reserved. 4. Create a list of student and then make it read only? 5. Create a list of 5 student name, and then rotate the list from the 3rd element of the list? 6. Store marks of 6 student (70, 40, 50, 48, 98, 56) in a sorted collection, now a) Get the highest marks, b) Get the lowest marks c) Get all the marks greater than or equal to 50. d) Get all the marks less than 50 e)Get marks between 40 and 70.