I cant digest the problem, please help me a bit.

You will develop three Java classes that interact with each other: Cashier, PriceAndStockManager and Product. Cashier objects are in charge of front-office operations, particularly purchases. These cashiers use a PriceAndStockManager object in charge of back office operations. This object provides the price of each product bought and updates the product inventories. Inside the PriceAndStockManager object, Product objects are managed and it is through these objects that prices are obtained and inventories are updated. The product objects are created when PriceAndStockManager is instantiated.

A Store class will be provided that tests all these classes that you will create, although we recommend that you test the Cashier, PriceAndStockManager and Product classes visually through the BlueJ environment

Basically, the program must have multiple objects of Cashier and Product class and single object of PriceAndStockManager class.

What I dont understand is that, why do we need to create multiple objects of Cashiers and Products if we can also do the same thing in a single object.

Can you give me an example why the problem seems confusing to me?
Thanks guys, i dont ask for codes, but a little snippet will do.

What I dont understand is that, why do we need to create multiple objects of Cashiers and Products if we can also do the same thing in a single object.

The basic idea of Object Oriented is that instances of a class represent "real" things. So you have a class Product (NOT Products!) that defines what a product is (eg they all have a name and a price), and you create many instances of that class each representing an individual product (with its own unique values for name and price).
Similarly a Cashier in general has various attributes and things they can do, but each instance of Cashier is an individual cashier with their own personal attributes.

Of course there's nothing to stop you just writing a whole chunk of code called "Products" that holds all the data and methods for anything to do with any number of products - that's how people did it before O.O. The downside is that its going to be big and complicated. O.O. splits it into a Product class, that has everything to do with individual products, and a PriceAndStockManager that handles everything to do with collections of products. Each of those two classes is much simpler to develop and to understand.

This article has been dead for over six months. Start a new discussion instead.