New Rich Text Document.rtf - Test Java Programming Final...

This preview shows page 1 - 4 out of 94 pages.

Test: Java Programming Final Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 3 (Answer all questions in this section) 1. Which of the following correctly defines a queue? Mark for Review (1) Points a list of elements with a first in last out order. a list of elements with a first in first out order. (*) something that enables you to create a generic class without specifying a type between angle brackets <>. it is a keyword in Java that restrict the use of the code to local users only. Incorrect. Refer to Section 3 Lesson 2. 2. A HashSet is a set that is similar to an ArrayList. A HashSet does not have any specific ordering. True or false? Mark for Review (1) Points True (*) False Correct 3. Which of the following correctly initializes an object named cell of the class Telephones whose generic type is Cellular? Mark for Review (1) Points Telephones cell = new Telephones(Cellular c); Telephones(Cellular) cell = new Telephones(Cellular); Telephones<> cell = new Telephones<>(Cellular c); Telephones cell = new Telephones(); (*) None of the above.
Image of page 1

Subscribe to view the full document.

Incorrect. Refer to Section 3 Lesson 2. 4. What is a set? Mark for Review (1) Points something that enables you to create a generic class without specifying a type between angle brackets <>. a collection of elements that does not contain duplicates. (*) a keyword in Java that initializes an ArrayList. a collection of elements that contains duplicates. Incorrect. Refer to Section 3 Lesson 2. 5. A LinkedList is a list of elements that is dynamically stored. True or false? Mark for Review (1) Points True (*) False Correct 6. When would an enum (or enumeration) be used? Mark for Review (1) Points When you want to be able to create any number of objects of that class. When you wish to initialize a HashSet. When you wish to remove data from memory. When you already know all the possibilities for objects of that class. (*) Incorrect. Refer to Section 3 Lesson 2. 7. Which scenario best describes a stack? Mark for Review (1) Points A pile of pancakes with which you add some to the top and remove them one by one from the
Image of page 2
top to the bottom. (*) A row of books that you can take out of only the middle of the books first and work your way outward toward either edge. A line at the grocery store where the first person in the line is the first person to leave. All of the above describe a stack. Incorrect. Refer to Section 3 Lesson 2. 8. Which of the following methods adds a Key-Value map to a HashMap? Mark for Review (1) Points put(Key, Value) (*) add(Key, Value) get(Key, Value) remove(Key, Value) Incorrect. Refer to Section 3 Lesson 2. 9. What are maps that link a Key to a Value? Mark for Review (1) Points Arrays ArrayLists HashSets HashMaps (*) Incorrect. Refer to Section 3 Lesson 2. 10. These are a list of elements that have a first in last out ordering.
Image of page 3

Subscribe to view the full document.

Image of page 4

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern