Java Bootcamp – Workbooks and Challenges
)}
The World of Objects (Challenge)

Part 2

From the Java Bootcamp Resources, launch Part 2.

2.png

Task 1

The Store constructor must grant this.movies the capacity to store 10 elements.

public Store() { // TODO }

Task 2

The getter must return a new copy of the Movie object being requested.

public Movie getMovie(int index) { // TODO return null; }

Task 3

The setter must update the array with a new copy of the Movie object.

public void setMovie(int index, Movie movie) { // TODO }

Task 4

Inside main(), populate the store (defined on top) with movies before printing it.

********************************MOVIE STORE******************************* 9.2 BlueRay The Shawshank Redemption 9.1 BlueRay The Godfather 9.0 DVD The Godfather: Part II 9.0 BlueRay The Dark Knight 8.9 DVD Schindlers List 8.9 BlueRay The Lord of the Rings: The Return of the King 8.8 DVD Pulp Fiction 8.8 DVD The Lord of the Rings: The Fellowship of the Ring

Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer

Feedback Summary
4.7
43 students
5

91%
4

2%
3

0%
2

0%
1

7%
Written Reviews
There are no written reviews yet.