Question: Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. //Key is a student name and

 Q1 ) Answer the following. (i) Create an HashMap object called

Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. //Key is a student name and value is an student id. (2 marks) (ii) Write a java program using HashMap(use above student) and implement two methods add student and search studentname. (2 marks) // Use your own class name. Q2) Consider the following Java program (2 marks) public class Square { private integer side; (i) ***** **Fill out the following details ******* public Square() l/initialize the parameter } public Square(integer s) { ? ------------ Ilinitialize the parameter } public double getArea() { -?----------side * side; } } Course Teacher: DCA Saahira bany / Assignment-2 (ii) Consider the subclass box of the superclass Square and call to the superclass default constructor & with its parameter. (2 marks) l/hint: public class box extends square { Il private double height; FILL OUT THE REMAINING PART OUTPUT SCREEN WITH THE PROGRAM CODING 2 MARKS

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!