Ản interface has the following prototypes. public interface Array{ int size=10; public void display(); // display the values of the array public int check (int num); // return 1 if num is found in the array, otherwise return 0 public void add (int num); // add unique elements in the array Define class ImpArray which do the following: 1. provide implementation of the interface Array. 2. Define an integer array and int count as attributes. 3. Provide a default constructor and create your array using the size defined in interface Array. For example: Test Result ImpArray arz = new ImpArray ();o arr.display(); O O O O

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

IMPLEMENT THE JAVA PROGRAM (SEE ATTACHED PHOTO FOR THE PROBLEM)

An interface has the following prototypes.
public interface Array{
int size=10;
public void display();
// display the values of the array
public int check (int num) ;
// return 1 if num is found in the array, otherwise return 0
public void add (int num) ;
// add unique elements in the array
Define class ImpArray which do the following:
1. provide implementation of the interface Array.
2. Define an integer array and int count as attributes.
3. Provide a default constructor and create your array using the size defined in interface
Array.
For example:
Test
Result
ImpArray arr = new ImpArray (); 0
arr.display();
O O O O
O O O O
Transcribed Image Text:An interface has the following prototypes. public interface Array{ int size=10; public void display(); // display the values of the array public int check (int num) ; // return 1 if num is found in the array, otherwise return 0 public void add (int num) ; // add unique elements in the array Define class ImpArray which do the following: 1. provide implementation of the interface Array. 2. Define an integer array and int count as attributes. 3. Provide a default constructor and create your array using the size defined in interface Array. For example: Test Result ImpArray arr = new ImpArray (); 0 arr.display(); O O O O O O O O
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,