Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 [3 + 2 + 3] A. Consider the following two interfaces P1 and P2. Complete the following tasks now: i.Write an interface named

image text in transcribed

Question 1 [3 + 2 + 3] A. Consider the following two interfaces "P1" and "P2". Complete the following tasks now: i.Write an interface named "P3" inheriting both "p1" and "P2" 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 1 interface P2 double h2(int x); String kl(); void k2(); 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 2 3 int y = 213; int x; public static void main(String[] args) { x = 50; // This should work after modification of x 6 7 8) 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 2 void introduce(); 3) 4 5 public class AnnonEx 6 public static void main(String[] args) 7 Person engineer; // Write your codes 8 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 1 13) Page 1 of 4 NN

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago