Lesson 43 Arrays Part 4 - User-defined Objects as Arrays

Опубликовано: 01 Январь 1970
на канале: JavaJourneyWithMadhavi
33
3

Link to the Book - Essentials of Computer Applications

https://www.amazon.in/Essentials-Comp...

Link to Lesson 39 Employee class
   • Lesson 39 Programming Logic Part 8 - Calli...  

Practice Exercise Objects as arrays
1. Create a class called Product with the following specifications.
Member variables: Name, price, quantity
Member methods: Default constructor, Parameterized constructor
Read method, Display method
Find bill which returns bill (price* quantity)
Create a main () method with objects as array concept – at most 5 objects, and call all the above methods
2. Create a class called Library with the following specifications.
Member variables: Name of the book, Author, Number of copies and price
Member methods: Default constructor, Parameterized constructor
Read method, Display method
Create a main () method with objects as array concept – at most 5 objects, and call all the above methods