Question
JAVA You are developing your own photo editing application. The standard free version allows you to draw and write text on a photo. The Pro
JAVA
You are developing your own photo editing application. The standard free version allows you to draw and write text on a photo. The Pro subscription has 2 more features - the ability to use effects and the ability to change resolution. Complete/fix the given code to inherit Pro class from Standard class and successfully execute all the given method calls.
Be attentive to access modifiers.
//be attentive to access modifiers
class Standard {
protected void draw() {
System.out.println("Drawing");
}
private void write() {
System.out.println("Writing");
}
}
//fix the class
class Pro{
protected void useEffects() {
System.out.println("Using Effects");
}
protected void changeResolution() {
System.out.println("Changing Resolution");
}
}
public class Main {
public static void main(String[] args) {
Standard standard1 = new Standard();
Pro pro1 = new Pro();
//standard version
standard1.draw();
standard1.write();
//Pro version
pro1.draw();
pro1.write();
pro1.useEffects();
pro1.changeResolution();
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started