Answered step by step
Verified Expert Solution
Question
1 Approved Answer
question 1 Course code : Object Oriented Programming I need this question answer with in 1 hour. using java language Question 1 [3 + 2
question 1
Course code : Object Oriented Programming
I need this question answer with in 1 hour. using java language
Question 1 [3 + 2 + 3] A. Consider the following two interfaces "p1" and "P2". Complete the following tasks now: i.Write an interface named "23" inheriting both "p1" and "2" ii. Now write a concrete class named "Concrete" inheriting from "P3" and overriding the required methods with proper signature i.e. proper access specifier, return type and parameters N.B. Just write only the solution codes interface P11 interface P2 String k1(); void k2(); double h2 (int x); B. Answer the following questions for the following "Fall" class: i.Suggest modifications for variable "x" so that Line Number 6 can be executed without any error ii.Suggest modifications for variable "y" so that value of it cannot be changed after Line Number 3 1 public class Fall int 3 int y - 213; 5 6 7 8 ] public static void main(String[] args) { x = 50; // This should work after modification of x } C. Create and assign an object of Person using anonymous inner class for both of Line 7 and 8 to produce output "Hello, I'm an Engineer" from line number 10 and "Hello, I'm a Doctor" from Line number 11. 1 interface Person void introduce(); 2 31 4 5 public class AnnonEx{ 6 public static void main(String[] args) { 7 Person engineer; // Write your codes Person doctor; // Write your codes 9 10 engineer.introduce(); // should print "Hello, I'm an Engineer" 11 doctor.introduce(); // should print "Hello, I'm a Doctor" 12 } 13)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