Chapter 4 JAVA OOP Features: 2.1 Questions
Chapter 4 JAVA OOP Features: 2.1 Questions
1. Slides
2. Homework
2.1 Questions
2.2 Programming
1. (The Circle class and the Rectangle class) Design two classes named Circle and
Rectangle that extend GeometricObject class. The UML diagrams for the
classes Circle , Rectangle and GeometricObject are shown below:
2. (Largest rows and columns) Write a program that randomly fills in 0s and 1s
into an n-by-n matrix, prints the matrix, and finds the rows and columns with the
most 1s. (Hint: Use two ArrayLists to store the row and column indices with the
most 1s.) Here is a sample run of the program:
3. (Remove duplicates) Write a method that removes the duplicate elements from
an array list of integers using the following header:
Write a test program that prompts the user to enter 10 integers to a list and
displays the distinct integers separated by exactly one space. Here is a sample run:
We won’t use online judge in this homework, so you should write your programs in
your local environment.
This homework’s deadline is 2020.11.10 23:59:59, submit your code and report to
my email([email protected]) on time please!