int dataOne) = { 1, 2, 3, 4, 5, 6 }; int dataTwo[] = { 1, 5, 8, 9, 10, 30, 20 ); public abstract class Final implements IFinal { public int arrOne0; public int arTwo[]; public Final() { arrOne = dataone; arrTwo - dataTwo; public Final(int a], int[] b) { arrOne =a; arrTwo - b; public abstract int] commonNumbers0/ returns an array that holds common mumbers in given aray: / for example: 1, 5 are common data in two arrays public abstract int maxCommonNumber(); / this method returns the biggest mumber in the common numbers. For example: "5" is the biggest mumber } / end of the "Final" class Write a class that uses the Final abstract class defined above. Your class should have two constructors. 1. Default constructor, doesn't take any data. 2. Overloaded constructor. It takes two integer arrays (define array with random numbers) Create two objects with using two different constructors and test all methods given in the "Final" class. For invalid inputs, you should throw exceptions (consider possible invalid inputs)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

java

interface IFinal{
int dataOne[] = { 1, 2, 3, 4, 5, 6 };
int dataTwo[] = { 1, 5, 8, 9, 10, 30, 20 };
}
public abstract class Final implements IFinal {
public int arOne];
public int anTwo[]:
public Final() {
arrOne = dataOne;
arrTwo = dataTwo;
}
public Final(int a], int[] b) {
arrOne = a;
arrTwo = b;
}
public abstract int[] commonNumbers);/ retuns an array that holds common mumbers in given arrays
/ for example: 1, 5 are common data in two arrays
public abstract int maxCommonNumber();
/ this method returns the biggest mumber in the common numbers. For example:
"5" is the biggest mumber
} / end of the "Final" class
Write a class that uses the Final abstract class defined above. Your class should have two constructors.
1. Default constructor, doesn't take any data.
2. Overloaded constructor. It takes two integer arrays (define array with random mmbers)
Create two objects with using two different constructors and test all methods given in the "Final" class.
For invalid inputs, you should throw exceptions (consider possible invalid inputs)
Transcribed Image Text:interface IFinal{ int dataOne[] = { 1, 2, 3, 4, 5, 6 }; int dataTwo[] = { 1, 5, 8, 9, 10, 30, 20 }; } public abstract class Final implements IFinal { public int arOne]; public int anTwo[]: public Final() { arrOne = dataOne; arrTwo = dataTwo; } public Final(int a], int[] b) { arrOne = a; arrTwo = b; } public abstract int[] commonNumbers);/ retuns an array that holds common mumbers in given arrays / for example: 1, 5 are common data in two arrays public abstract int maxCommonNumber(); / this method returns the biggest mumber in the common numbers. For example: "5" is the biggest mumber } / end of the "Final" class Write a class that uses the Final abstract class defined above. Your class should have two constructors. 1. Default constructor, doesn't take any data. 2. Overloaded constructor. It takes two integer arrays (define array with random mmbers) Create two objects with using two different constructors and test all methods given in the "Final" class. For invalid inputs, you should throw exceptions (consider possible invalid inputs)
Expert Solution
steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT