interface IResit { int number = 3; char iChar = #"; interface IShape extends IResit { public void drawShape ( ); i this method supposed to draw shapes with interface data as below: } interface IBilgi { public void myShape(char myChar); il this method supposed to draw shapes as below I/ if, myChar = ** #*#* */ } // note the "#" character comes from interface Il end of the interface... Write a class that implements interfaces given above. Your class should: 1. Have three constructors 1. Default constructor: it doesn't take any parameter and necessary variables will be initialized by interface data. 2. Overloaded Constructor: takes one integer parameter, supposed to initialize the "number" variable 3. Overloaded Constructor: takes two parameters to initialize "number" and "iChar"variables 2. Create three different objects from three different constructors and test all methods given in interfaces 3. Your code should throw exceptions for invalid inputs I/ Note you must solve this question with using "while" loop only.

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

JAVA PROGRAMMING LANGUAGE

 

interface IResit {

int number = 3;

char iChar = ‘#’;

}

 

interface IShape extends IResit {

public void drawShape ( );

// this method supposed to draw shapes with interface data as below:

/*

#

##

###

##

#

*/

}

interface IBilgi {

public void myShape(char myChar);

// this method supposed to draw shapes as below

// if , myChar = ‘*’

 

/*

#*

##

###*

##

#*

*/

} // note the “#” character comes from interface

// end of the interface….

/*

Write a class that implements interfaces given above. Your class should:

1. Have three constructors

Default constructor: it doesn’t take any parameter and necessary variables will be initialized by interface data.
Overloaded Constructor: takes one integer parameter, supposed to initialize the “number” variable
Overloaded Constructor: takes two parameters to initialize “number” and “iChar”variables

2. Create three different objects from three different constructors and test all methods given in interfaces

3. Your code should throw exceptions for invalid inputs

*/

// Note you must solve this question with using “while” loop only.

interface IResit {
int number = 3;
char iChar = '#";
}
interface IShape extends IResit {
public void drawShape ( );
i this method supposed to draw shapes with interface data as below:
}
interface IBilgi {
public void myShape(char myChar);
Il this method supposed to draw shapes as below
Il if, myChar = *
}/ note the "#" character comes from interface
Il end of the interface...
Write a class that implements interfaces given above. Your class should:
1. Have three constructors
1. Default constructor: it doesn't take any parameter and necessary variables will be initialized by interface data.
2. Overloaded Constructor: takes one integer parameter, supposed to initialize the “number" variable
3. Overloaded Constructor: takes two parameters to initialize "number" and "iChar"variables
2. Create three different objects from three different constructors and test all methods given in interfaces
3. Your code should throw exceptions for invalid inputs
*/
I/ Note you must solve this question with using "while" loop only.
Transcribed Image Text:interface IResit { int number = 3; char iChar = '#"; } interface IShape extends IResit { public void drawShape ( ); i this method supposed to draw shapes with interface data as below: } interface IBilgi { public void myShape(char myChar); Il this method supposed to draw shapes as below Il if, myChar = * }/ note the "#" character comes from interface Il end of the interface... Write a class that implements interfaces given above. Your class should: 1. Have three constructors 1. Default constructor: it doesn't take any parameter and necessary variables will be initialized by interface data. 2. Overloaded Constructor: takes one integer parameter, supposed to initialize the “number" variable 3. Overloaded Constructor: takes two parameters to initialize "number" and "iChar"variables 2. Create three different objects from three different constructors and test all methods given in interfaces 3. Your code should throw exceptions for invalid inputs */ I/ Note you must solve this question with using "while" loop only.
Expert Solution
steps

Step by step

Solved in 4 steps with 7 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,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage