Hamza K.

asked • 06/27/21

Question in java language please answer ASAP

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.

1 Expert Answer

By:

Patrick B. answered • 06/27/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.