Question Task 3: Write a main() method inside of the ReadMethod class, having the following: 1. Let the user input an integer 2. Create a new instance of the ReadMethod class with 3 input arguments: the input integer, a String "Talk yourInput/neger times", a String "English" 3. Display the instance on the console. Your console display must match the following: input an integer: 1000 input-1000, output-Talk 1000 times isHard: true, language English, Specific Way: Speak Loud!
methode code below
abstract class Method {
// declaration of variables
protected int input;
protected String output;
// Abstract methods
public abstract boolean isHard();
public abstract String specificWay();
public abstract void Method();
public abstract void Method(int input, String output);
// Getter methods for the input field
public int getInput() {
return this.input;
}
// Setter methods for the input field
public void setInput(int input) {
this.input = input;
}
// Getter methods for the output field
public String getOutput() {
return this.output;
}
// Setter methods for the output field
public void setOutput(String output) {
this.output = output;
}
// Custom string representation of the object
public String toString() {
return "Method";
}
}
Step by step
Solved in 3 steps