java unit 1
java unit 1
ram becomes larger, a single list of Application of oop: The most popular application using Object Oriented
encouraging and facilitating re-use of software components.
instructions becomes unwieldy programming is the interface designing for window base systems. Real systems are
It employs international standard Unified Modeling Language (UML) from the
A program is divided into functions or subroutines where each function has a clearly more complex and contain many objects with a large number of attributes and methods
Object Management Group (OMG).
defined purpose and a defined interface to the other functions in the program of complex nature. OOP is useful in such cases because it can simplify a complex
Using this methodology, a system can be developed on a component basis, which
Structured programming remained the leading approach for almost two decades. problem. The application area of OOP includes:
enables the effective re-use of existing components, it facilitates the sharing of its
• Object Oriented databases
other system components.
Object oriented programming: The world is Object Oriented, and Object Oriented • Embedded systems
Object Oriented Methodology asks the analyst to determine what the objects of the
programming expresses programs in the ways that model how people perceive the • Simulation and modeling
system are?, What responsibilities and relationships an object has to do with the
world.?? # In object oriented oriented programming, main emphasis is an data rather • Neural networks
other objects? and How they behave over time?
than functions.?? #The basic principe of object oriented oriented programming is to • Decision support systems
combine both data and functions into a single unit known as “object”.# it follow • Office automation systems
Programming paradigm:Programming paradigm is frame work that defines
bottom-up approaches.??#it deal with data??# oop is highly secure.??#it take more • AI and expert systems
how the user cocepyualized and interpets complex problems. ??#It is also a
memory than procedural language.??#In opp, overloading and data hiding is • CAD/CAM systems
fundamenteal style or approach used in software engineering to
possible.??#ex:-java,c++,etc • Internet solutions
implement a programming language.
Advantages of opp:
Differcence between programing paradigm and programming We can build the programs from standard working modules that Concept of oop approach:The main components of Object Oriented
languages: communicate with one another, rather than having to start writing the code
from scratch which leads to saving of development time and higher technology are ‘objects and classes’, ‘data abstraction and encapsulation’,
*Programming language:it is an artificial language that has vocabulary and steps
productivity, ‘inheritance’ and ‘polymorphism’. It is very important for you to understand these
of grammatical rules to instruct a computer to perform specific tasks. OOP language allows to break the program into the bit-sized problems that concepts.
*programming paradigm: it is a particular way of looking at a programming can be solved easily (one object at a time).
Further, in this unit you can find the details of these concepts. Objects Object
The new technology promises greater programmer productivity, better
problem. Data + Functions
quality of software and lesser maintenance cost.
OOP systems can be easily upgraded from small to large systems. Object: Let’s start with “Object”. The first thing that we should do in the Object
Evaloution of oo methodology: The earliest computers were It is possible that multiple instances of objects co-exist without any Oriented approach is to start thinking in terms of Objects. The problem to be
interference,
programmed in machine language using 0 and 1. The mechanical switches were used to solved is divided into objects. Start analyzing the problem in terms of objects and
It is very easy to partition the work in a project based on objects.
load programs. Then, to provide convenience to the programmer, assembly language the nature of communication between them. Program object should be chosen
It is possible to map the objects in problem domain to those in the program.
The principle of data hiding helps the programmer to build secure programs such that they match closely with real-world objects
was introduced where programmers use pneumonic for various instructions to write
which cannot be invaded by the code in other parts of the program. • Employees in a payroll system
programs.
But it was a tedious job to remember so many pneumonic codes for various • Customers and accounts in a banking system
Disadvantages of opp:
instructions. Other major problem with the assembly languages is that they are machine The length of the programmes developed using OOP language is much • Salesman, products, customers in a sales tracking system
architecture dependent. To overcome the difficulties of Assembly language, high-level larger than the procedural approach. Since the programme becomes larger • Data structures like linked lists, stacks, etc.
languages came into existence. Programmers could write a series of English-like in size, it requires more time to be executed that leads to slower execution of
the programme. • Hardware devices like magnetic tape drive, keyboard, printer etc
instructions that a compiler or interpreter could translate into the binary language of We can not apply OOP everywhere as it is not a universal language. It is
computers directly. applied only when it is required. It is not suitable for all types of problems. . • GUI elements like windows, menus, events, etc. in any window-based
Programmers need to have brilliant designing skill and programming skill application.
These languages are simple in design and easy to use because programs at that time
along with proper planning because using OOP is little bit tricky.
were relatively simple tasks like any arithmetic calculations OOPs take time to get used to it. The thought process involved in object-
oriented programming may not be natural for some people.
Facilitates code reuse by allowing developers to focus on higher-level interactions Code Reusability: Subclasses can reuse the functionality of their parent classes
without worrying about specific implementations. while adding specific customizations.
Enhances modularity, making it easier to develop and maintain large systems. Maintainability: Changes to the superclass implementation can be handled
through the subclass, making the code more modular and easier to maintain.
In object-oriented
In procedural programming, there
programming, the concept of
is no concept of data hiding and
data hiding and inheritance is
inheritance.
used.