Creating our own classes that represent real world entities are a basic coding task nowadays. For example, a project dealing with ecommerce apps will need to create Product, Category, Cart etc. kinds on user defined classes. A finance app will contain Fund, Account etc. classes. All these classes will contain information related to the entity they represent. As an example, we can build a Product class that may have information like product Id, product name, category, sub products, price, created by etc. These user-defined classes are objects, that are created with information or data about the instance itself. Objects are often combined or grouped together as per the requirement. For example, objects of Product class can be grouped in an Array or ArrayList. Now, imagine you want to see the list of products. Simple, iterate over the list and print the product values. However, user wants to see the list in order of ascending order of names or more realistically, in order of pr...
Comments
Post a Comment