OOP in Java Unit1
OOP in Java Unit1
1
By: Manoj Sapkota, Nepal Polytechnic Institute
2
By: Manoj Sapkota, Nepal Polytechnic Institute
Advantages of OOP:
• The modeling of real-world problems become easy by using OOP as it
represents all the real-world entities as objects.
• By the use of inheritance, the redundant codes are eliminated and the
existing features can be extended.
• It supports encapsulation, i.e., the data and functions are wrapped
inside a single unit. The data is protected from the outside and only the
associated functions can access them. So, it provides more security to
the system.
• With the help of polymorphism, the same function or operator can be
used for various purposes. This helps to manage the complexity of the
software with ease.
• Large problems can be reduced to smaller and manageable ones. It is
easy to partition the work in a project based on objects.
• Object oriented system can be easily upgraded from small to a large
system.
• Software complexity can be easily managed.
• It supports abstraction so that the internal implementation can be
modified without affecting the user. It helps to increase the security of
the system.
Disadvantages of OOP:
• It has a steep learning curve and can be complex for beginners.
• It can lead to performance overhead.
• Code written in OOP tends to be larger.
• It might be inefficient for simple and straightforward problems.
• Integrating OOP with relational databases can be problematic.
• Overuse of inheritance can lead to tightly coupled systems.
3
By: Manoj Sapkota, Nepal Polytechnic Institute
MODEL/IMPORTANT QUESTIONS:
1. What is object-oriented approach? What are the advantages of OOP
over procedural oriented programming? Explain.
2. What are the features/principles of OOP? Explain.
3. What are the differences between Object Oriented Programming
(OOP) and Procedural oriented programming? Explain.