Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. I/Key is a student name and
Q1 ) Answer the following. (i) Create an HashMap object called Student to add a key and its value. I/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; ***** **Fill out the following details ******* public Square() { l/initialize the parameter } public Square(integer s) { ------- //initialize 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
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