Question: 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 Course code : Object Oriented Programming I need this question

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!