Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2019/2020 Umm Al Qura university Computer & Information Systems college Instructor: Dr. Aymen M. Akremi Lab 08: Object Oriented Programming Objectives: This lakh will give

image text in transcribed
2019/2020 Umm Al Qura university Computer & Information Systems college Instructor: Dr. Aymen M. Akremi Lab 08: Object Oriented Programming Objectives: This lakh will give you practical implementation and tests of generic programs Exercise 1 Given name, number) pairs A = ((Bob, 41. (Amber, 5). (George, 3), (Will, 7, write a Java class with method for: (1) inserting these pairs into a pair of ArrayList structures called NameAL and Number AL (2) displaying the pairs to the screen as "My name is name and I am in Year" number at University You can choose what to name your dass and method, but your solution should forma complete class that can be compiled. Create another class for testing the pair class Exercise 2: Write a class called Generichox which takes a generic type parameter holds a content of type E The constructor, getter and setter work on the parameterized type E. The toString() reveals the actual type of the content The following class tests the class Generic Box public class TestGenericBox Output: public static void main(Strinellargs Generic llocString boxi-new Generic oxbu2 = new GenericBoxcinteger>(123) 55.66 (class java.lang Double) Intibox2.getContent System.out.println(box2 GenericBox Double> box3 new Generic Box Double55.661 doubled-box3.getContent); System.out.printinibo 3: 1

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

More Books

Students also viewed these Databases questions

Question

What must a creditor do to become a secured party?

Answered: 1 week ago

Question

When should the last word in a title be capitalized?

Answered: 1 week ago