Question: Eclipse Debugger Program 6 Use the previous ArrayList assignment to demostrate the Eclipse debugger. If you havent completed that assignment, you can use another previous

Eclipse Debugger Program 6

Use the previous ArrayList assignment to demostrate the Eclipse debugger. If you havent completed that assignment, you can use another previous assignment. The demostration project must have at least one method other than main.

Requirements

  1. Set (toggle) a breakpoint. Run to the breakpoint.
  2. Demostrate the debug toolbar that opens in Eclispe at the top left.
    1. Step Into
    2. Step Over
    3. Step Return
    4. Drop To Frame
    5. Resume (to second breakpoint)
    6. Skip All Breakpoints
  3. Demostrate the debug windows that open on the right.
    1. Variables
    2. Breakpoints
    3. Expressions

Exercise Program 5

Provide links to videos for all exercises.

Array List

The ArrayList class creates an array that can resize on demand. Once you learn about ArrayList, there is little reason to use arrays. The container allocates more memory automatically as more elements are added.

Requirments and Rubric

Write a test program that does the following:

  1. Create a new empty ArrayList of String type called testList
  2. Print the current size of testList.
  3. Add at least 5 elements to testList.
  4. Print testList. ArrayList has a toString method so its easy to print.
  5. Using get(0), print the first element of testList.
  6. Print the last element of testList. This time, do no use a constant to get the last element, use testList. Size().
  7. Use a for loop to print each element of testList.
  8. Use a for-each loop to print each element of testList.
  9. Use Collections.sort(testList) to sort your ArrayList.
  10. Use the testList.remove(0) method to remove the first element of the list. remove(0). Put this call inside a println statement so you can observe the return value. Print testList.
  11. Use the remove method to remove a specific string by its string value. Put this call inside a println statement so you can observe the return value. Print testList.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!