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.
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.
Step by step
Solved in 4 steps with 7 images