Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Subclasses of an abstract class in Python are not required to implement abstract methods of the parent class.
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Subclasses of an abstract class in Python are not required to implement abstract methods of the parent class.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
Python Class | Python Programming | Python Tutorial | EdurekaEdureka!
( Python Training : https://www.edureka.co/python )
This Edureka Python Class tutorial (Python Tutorial Blog: https://goo.gl/wd28Zr) will help you understand Python Classes and Objects with examples. It will also explain the concept of Abstract Classes and Inheritance in python.
Check out our Python Training Playlist: https://goo.gl/Na1p9G
This Python Programming tutorial video helps you to learn following topics:
1. Python Classes and Objects
2. Inheritance
3. Abstract Classes
Object oriented programming 6 oop with c++Vaibhav Khanna
Object Oriented Programming is a paradigm that provides many concepts such as inheritance, data binding, polymorphism etc. The programming paradigm where everything is represented as an object is known as truly object-oriented programming language.
YouTube Link: https://youtu.be/QswQA1lRIQY
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Collections In Python' will cover the concepts of Collection data type in python along with the collections module and specialized collection data structures like counter, chainmap, deque etc. Following are the topics discussed:
What Are Collections In Python?
What Is A Collection Module In Python?
Specialized Collection Data Structures
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This is the presentation file about inheritance in java. You can learn details about inheritance and method overriding in inheritance in java. I think it's can help your. Thank you.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
Python Class | Python Programming | Python Tutorial | EdurekaEdureka!
( Python Training : https://www.edureka.co/python )
This Edureka Python Class tutorial (Python Tutorial Blog: https://goo.gl/wd28Zr) will help you understand Python Classes and Objects with examples. It will also explain the concept of Abstract Classes and Inheritance in python.
Check out our Python Training Playlist: https://goo.gl/Na1p9G
This Python Programming tutorial video helps you to learn following topics:
1. Python Classes and Objects
2. Inheritance
3. Abstract Classes
Object oriented programming 6 oop with c++Vaibhav Khanna
Object Oriented Programming is a paradigm that provides many concepts such as inheritance, data binding, polymorphism etc. The programming paradigm where everything is represented as an object is known as truly object-oriented programming language.
YouTube Link: https://youtu.be/QswQA1lRIQY
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Collections In Python' will cover the concepts of Collection data type in python along with the collections module and specialized collection data structures like counter, chainmap, deque etc. Following are the topics discussed:
What Are Collections In Python?
What Is A Collection Module In Python?
Specialized Collection Data Structures
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This is the presentation file about inheritance in java. You can learn details about inheritance and method overriding in inheritance in java. I think it's can help your. Thank you.
Introduction to Java: History, Versioning, The Java Virtual Machine, Byte code, Writing simple
java program, Language Components: Primitive Data Types, Comments, Keywords, literals, The
break Statement, The continue Statement, Operators – Casts and Conversions, Arrays. Introduction
to classes and methods, constructors, Passing Objects to Methods, Method Overloading, Static and
final, The this Reference, finalize, inner and nested classes. Inheriting class, extends, member
access and inheritance, super keyword, Object class. Dynamic method dispatch, method overriding,
abstract class, interface, packages, import statement
A Java compiler is a compiler for the development terminology Java. The most frequent way of outcome from a Java compiler is Java category data files containing platform-neutral Java bytecode,
Java can be used two types of programs: applications & applets.An application is a program that runs on your computer, under the operating system of that computer.
An applets is an application designed to be transmitted over the Internet and executed by a java-compatible Web Browser. An applet is an executable program that runs inside a browser, such as Netscape or Internet Explorer.
Java is a general-purpose; object oriented programming language developed by Sun Microsystems of USA in 1991. This language was initially called “Oak” by James Gosling, but was renamed “Java” in 1995. Java (with a capital J) is a high-level, third generation programming language, like C, Fortran, Smalltalk, Perl, and many others.Java was initially designed to solve on a small scale could also be applied to the Internet on a large scale. This realization caused the focus of Java to switch from consumer electronic to Internet Programming.Java was designed for the development of software for consumer electronic devices like TVs, VCRs, Toasters, Microwaves ovens and such other electronics devices.Java is a first programming language that is not tied to any particular hardware or operating system. Programs developed in Java can be executed anywhere on any system.
TechSearhWeb is a tutorial site for different technologies to make quality education. We want to spread good education worldwide. The aim is to understand the language very easily and get through any problem to understand the basics and advance of any language.
This website has been developed for every people to get more knowledge for every person, share their knowledge, and be ready to get a job.
Read More Here:
https://www.techsearchweb.com
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
2024.06.01 Introducing a competency framework for languag learning materials ...
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
1. UNIT 1
OBJECT ORIENTED ROGRAMMING
UNIT STRUCTURE
Basics overview of programming paradigms
Features of OOPS
Classes
Encapsulation
Polymorphism
Inheritance
LEARNING OBJECTIVES
After going through this unit, you should be able to:
find the importance of OO approach;
define the basic concepts of OO approach;
differentiate between object and procedure-oriented approaches;
know about various OO languages;
describe the applications of OOP, and
Understand the benefits of OO approach.
1. Object oriented programming
Java's origins go back to 1991, when Sun Microsystems began looking for ways to create
platform-independent code to support consumer electronic products. After some initial
efforts with C++, the Sun project team abandoned it and created its own language initially
called Oak, later renamed Java. Oak first was used to create software for a personal, handheld remote control device, but when the project team lost a bid to develop a television settop box for Time-Warner, attention switched to the Web. The Sun project team then built a
Web browser, originally called WebRunner and then renamed HotJava, in the Java
programming language. The rest, as they say, is history: Sun formally announced Java and
HotJava at the SunWorld '95 conference in San Francisco on May 23, 1995.
2. Object-oriented programming (OOP) is a programming language model organized around
objects rather than "actions" and data rather than logic. Historically, a program has been viewed
as a logical procedure that takes input data, processes it, and produces output data. The
programming challenge was seen as how to write the logic, not how to define the data. Objectoriented programming takes the view that what we really care about are the objects we want to
manipulate rather than the logic required to manipulate them. Examples of objects range from
human beings (described by name, address, and so forth) to buildings and floors (whose
properties can be described and managed) down to the little widgets on a computer desktop (such
as buttons and scroll bars).
Real world objects
The first step in OOP is to identify all the objects the programmer wants to manipulate and how
they relate to each other, an exercise often known as data modeling. Once an object has been
identified, it is generalized as a class of objects (think of Plato's concept of the "ideal" chair that
stands for all chairs) which defines the kind of data it contains and any logic sequences that can
manipulate it. Each distinct logic sequence is known as a method. Objects communicate with
well-defined interfaces called messages.
3. The concepts and rules used in object-oriented programming provide these important
benefits:
a)
The concept of a data class makes it possible to define subclasses of data objects that
share some or all of the main class characteristics. Called inheritance, this property of
OOP forces a more thorough data analysis, reduces development time, and ensures more
accurate coding.
b)
Since a class defines only the data it needs to be concerned with, when an instance of that
class (an object) is run, the code will not be able to accidentally access other program
data. This characteristic of data hiding provides greater system security and avoids
unintended data corruption.
c)
The definition of a class is reuseable not only by the program for which it is initially
created but also by other object-oriented programs (and, for this reason, can be more
easily distributed for use in networks).
d)
The concept of data classes allows a programmer to create any new data type that is not
already defined in the language itself.
EVOLUTION OF OO METHODOLOGY
Simula was the first object-oriented programming language. Java, Python, C++, Visual Basic
.NET and Ruby are the most popular OOP languages today. The Java programming language is
designed especially for use in distributed applications on corporate networks and the Internet.
Ruby is used in many Web applications. Curl, Smalltalk, Delphi and Eiffel are also examples of
object-oriented programming languages.
Java is an object-oriented programming language based on C++ that allows small programs -- or
"applets" -- to be embedded within an HTML document. When the user clicks on the appropriate
part of the HTML page to retrieve it from a Web server, the applet is downloaded into the client
workstation environment, where it begins executing. [Editor's note: Since this text was written,
the definition of Java has expanded beyond Web-based applets; Sun expects the language to be
used for all sorts of applications, and promises a Java operating system, Java microprocessors,
and more -- and now refers to Java as a platform.
4. The relationship among Java programs (or "applets"), the Java-enabled browser, and the Web is
illustrated in Figure. Users access a Web page and pull it down to their client. In this case,
though, the Web page contains an additional HTML tag called "APP," which refers to a Java
applet, and that applet can be located anywhere on the Web. If the user's Web browser is Javaenabled (for example, Sun's HotJava browser or Netscape's Navigator 2.0), then the applet is
pulled down into the user's client computer and executed within the browser environment.
Java is often described as a "cross-platform" programming language; it's also common to refer to Java
programs as "architecture-neutral byte codes." It has to be this way, of course, because the Web server
that delivers the Java applet to the Web client doesn't know what kind of hardware/software environment
it's running on. And the developer who creates the Java applet doesn't want to worry about whether it will
work correctly on OS/2, Windows, Unix, and MacOS.
1) The Java compiler, javac, which translates human-readable Java source code to
architecture-neutral bytecodes.
2) The Java interpreter, which executes Java programs on the user's PC or workstation.
3) The C header and source file generator, javah and java_g. These are used to generate
header files for C, as well as source files for making "methods" (roughly equivalent to
procedures or subroutines in other languages) within Java.
4) The Java disassembler, javap, which prints out information about a class file (a file
containing a Java applet).
5) The document generator, javadoc, which is capable of generating an HTML file from a
Java source-code file.
6) The profiling tool, javaprof, which formats the performance data created if the
programmer uses the -prof option in the Java interpreter to obtain statistics on run time
and performance.
Security and robust behavior
Security and robustness are obviously important in the distributed environment represented by
the Internet; if you download a Java applet from a Web server, for example, you really don't
want it to run amok on your computer and delete all the files on your hard disk. This is not as farfetched as it might sound, because the incorporation of Java applets into Web pages means that
you may be invoking computer programs written by people anywhere in the world, located
anywhere on the Web. Indeed, once you begin using a Java-enabled browser, you're
automatically at risk since you don't know at the moment you decide to retrieve a Web page (say,
5. by clicking on a hyperlink within an existing page being displayed on your computer) whether it
will contain embedded Java applets.
Sun has addressed this concern by imposing severe constraints on the Java programming
language, as well as extensive run-time checking in the interpreter located inside the Javaenabled browser. The Java language, for example, forbids the use of address pointers and pointer
arithmetic found in C and C++; this eliminates a large class of innocent errors that might
otherwise plague the user of Java applets. In addition, the following steps have been taken to
increase the level of security and robust behavior:
1) The Java run-time interpreter verifies that bytecodes (the compiled architecture-neutral
form of Java applet that gets downloaded from the Web server into the user's machine)
don't violate any language constructs -- which could happen if an altered Java compiler
was used by a hacker. The verification logic checks to make sure that the Java applet
doesn't access restricted memory, forge memory pointers, or access objects in a manner
inconsistent with its definition. It also ensures that method (subroutine) calls include the
correct number of arguments of the right type, and that there are no stack overflows.
2) During loading of the Java applet, the run-time interpreter verifies class names (a "class"
is an entire Java applet) and access restrictions.
3) If a Java applet attempts to access a file for which it has no permission, a dialog box will
pop up to allow the user to continue or stop the execution of the applet.
4) Future releases of Java are planned to have facilities for using public key encryption to
verify the source and origin of the Java source code and its integrity after traveling
through the network to reach the user's machine.
5) At run time, information about the origin of the Java applet can be used to decide what
the applet is allowed to do. For example, a security mechanism can be used to determine
whether the compiled Java byte codes originated from within an organization's security
firewall or not. This makes it possible to set a security policy that restricts the use and
execution of Java code that an organization doesn't know or trust.
6. This last point is crucial, for there are likely to be a number of attempts -- both innocent and
malicious -- to circumvent the security mechanisms that Sun has built into the language. In its
white paper on the Java language, Sun expresses the following optimistic statement about Java
security: Java is designed to operate in distributed environments, which means that security is of
paramount importance. With security features designed into the language and run-time system,
Java lets you construct applications that can't be invaded from outside. In the networked
environment, applications written in Java are secure from intrusion by unauthorized code
attempting to get behind the scenes and create viruses or invade file systems. For the securityconscious organizations, though, the firewall protection mentioned above will be crucial -- at
least in the short term.
Basics overview of programming paradigms,
The term paradigm describes a set of techniques, methods, theories and standards that together represent
a way of thinking for problem solving. According to [Wegner, 1988], paradigms are “patterns of
thought for problem solving”. Language paradigms were associated with classes of languages. First the
paradigms are defined. Thereafter, programming languages according to the different paradigms are
classified. The language paradigms are divided into two parts, imperative and declarative paradigms as
shown in the Figure 1. Imperative languages can be further classified into procedural and object
oriented approach. Declarative languages can be classified into functional languages and logical
languages. In Figure1 the examples of languages in each category are also given.
7. Language Paradigms
Computer programmers have evolved from the early days of the bit processing first generation
languages into sophisticated logical designers of complex software applications. A programming
paradigm is the logical approach used in software engineering that describes how a programming
language is implemented. Programming paradigms are unique to each language within the
computer programming domain, and many programming languages utilize multiple paradigms.
The term paradigm is best described as a "pattern or model." Therefore, a programming
paradigm can be defined as a pattern or model used within a software programming language to
create software applications.
Programming languages are extremely logical and follow standard rules of mathematics. Each
language has a unique method for applying these rules, especially around the areas of functions,
variables, methods, and objects. There are many programming paradigms; examples include
object oriented, procedural, and structured programming. Each paradigm has unique
requirements on the usage and abstractions of processes within the programming language.
Features of OOPS
Object oriented methods are favored because many experts agree that Object Oriented techniques
are more disciplined than conventional structured techniques. (Martin and Odell 1992)
The main components of Object Oriented technology are „objects and classes‟, „data
abstraction and encapsulation‟, „inheritance‟ and „polymorphism‟. It is very important for
you to understand these concepts. Further, in this unit you can find the details of these concepts.
a) Object oriented programming (OOP) is a programming model where Programs are
organized around object and data rather than action and logic. OOP allow decomposition
of a problem into a number of entities called Object and then builds data and function
around these objects.
b) The Program is divided into number of small units called Object. The data and function
are build around these objects.
c) The data of the objects can be accessed only by the functions associated with that object.
d) The functions of one object can access the functions of other object.
8. OOP has the following important features.
Class:
A class is the core of any modern Object Oriented Programming language.
In OOP languages it is must to create a class for representing data. Class is a
blueprint of an object that contains variables for storing data and functions to
performing operations on these data. Class will not occupy any memory space and
hence it is only logical representation of data.
To create a class, you simply use the keyword "class" followed by the class name:
class Employee
{
}
Object:
Objects are the basic run-time entities in an object oriented system.They may represent a
person,a
place
"Object
is
or
a
any
Software
item
bundle
that
of
the
related
program
variable
has
to
and
handle.
methods."
“Object is an instance of a class”
Class will not occupy any memory space. Hence to work with the data represented
by the class you must create a variable for the class, which is called as an object.
When an object is created by using the keyword new, then memory will be allocated
for the class in heap memory area, which is called as an instance and its starting
address will be stored in the object in stack memory area.
9. When an object is created without the keyword new, then memory will not be
allocated in heap I.e. instance will not be created and object in the stack contains
the value null.
When an object contains null, then it is not possible to access the members of the
class using that object.
class Employee
{
}
Syntax to create an object of class Employee:Employee objEmp = new Employee();
Similarly, the following can be treated as objects in different programming problems:
Employees in a payroll system
Customers and accounts in a banking system
Salesman, products, customers in a sales tracking system
Data structures like linked lists, stacks, etc.
Hardware devices like magnetic tape drive, keyboard, printer etc.
GUI elements like windows, menus, events, etc. in any window-based application.
10. All the programming languages supporting object oriented Programming will be
supporting these three main concepts:
1. Encapsulation
2. Inheritance
3. Polymorphism
Abstraction:
Abstraction is "To represent the essential feature without representing the back
ground details."
Abstraction lets you focus on what the object does instead of how it does it.
Abstraction provides you a generalized view of your classes or object by providing
relevant information.
Abstraction is the process of hiding the working style of an object, and showing the
information of an object in understandable manner.
Real world Example of Abstraction: Suppose you have an object Mobile Phone.
Suppose you have 3 mobile phones as following:Nokia 1400 (Features:- Calling, SMS)
Nokia 2700 (Features:- Calling, SMS, FM Radio, MP3, Camera)
Black Berry (Features:-Calling, SMS, FM Radio, MP3, Camera, Video Recording,
Reading E-mails)
Abstract information (Necessary and Common Information) for the object "Mobile
Phone" is make a call to any number and can send SMS."
so that, for mobile phone object you will have abstract class like following:abstract class MobilePhone
{
public void Calling();
public void SendSMS();
}
public class Nokia1400 : MobilePhone
{
}
public class Nokia2700 : MobilePhone
{
11. public void FMRadio();
public void MP3();
public void Camera();
}
public class BlackBerry : MobilePhone
{
public void FMRadio();
public void MP3();
public void Camera();
public void Recording();
public void ReadAndSendEmails();
}
Abstraction means putting all the variables and methods in a class which are
necessary.
For example: - Abstract class and abstract method.
Abstraction is the common thing.
example:
If somebody in your collage tell you to fill application form, you will fill your
details like name, address, data of birth, which semester, percentage you have got
etc.
If some doctor gives you an application to fill the details, you will fill the details
like name, address, date of birth, blood group, height and weight.
See in the above example what is the common thing?
Age, name, address so you can create the class which consist of common thing that
is called abstract class.
That class is not complete and it can inherit by other class.
Encapsulation:
Wrapping up data member and method together into a single unit (i.e. Class) is
called Encapsulation.
Encapsulation is like enclosing in a capsule. That is enclosing the related operations
and data related to an object into that object.
Encapsulation is like your bag in which you can keep your pen, book etc. It means
this is the property of encapsulating members and functions.
class Bag
{
book;
pen;
ReadBook();
}
12. Encapsulation means hiding the internal details of an object, i.e. how an object does
something.
Encapsulation prevents clients from seeing its inside view, where the behaviour of
the abstraction is implemented.
Encapsulation is a technique used to protect the information in an object from the
other object.
Hide the data for security such as making the variables as private, and expose the
property to access the private data which would be public.
So, when you access the property you can validate the data and set it.
Example:
class Demo
{
private int _mark;
public int Mark
{
get { return _mark; }
set { if (_mark > 0) _mark = value; else _mark = 0; }
}
}
Real world Example of Encapsulation:Let's take example of Mobile Phone and Mobile Phone Manufacturer
Suppose you are a Mobile Phone Manufacturer and you designed and developed a
Mobile Phone design(class), now by using machinery you are manufacturing a
Mobile Phone(object) for selling, when you sell your Mobile Phone the user only
learn how to use the Mobile Phone but not that how this Mobile Phone works.
This means that you are creating the class with function and by making object
(capsule) of it you are making availability of the functionality of you class by that
object and without the interference in the original class.
Example-2:
TV operation
It is encapsulated with cover and we can operate with remote and no need to open
TV and change the channel.
Here everything is in private except remote so that anyone can access not to operate
and change the things in TV.
13. Inheritance: Inheritance is the process by which objects of one class acquire the properties of
objects of another class in the hierarchy. For example, the scooter is a type of the class twowheelers, which is again a type of (or kind of) the class motor vehicles. As shown in the Figure 5
the principle behind it is that the derived class shares common characteristics with the class from
which it is derived.New classes can be built from the existing classes. It means that we can add
additional features to an existing class without modifying it. The new class is referred as derived
class or sub class and the original class is known as base class or super class. Therefore, the
concept of inheritance provides the idea of reusability. This inheritance mechanism allows the
programmer to reuse a class that is made almost, but not exactly, similar to the required one by
adding a few more features to it. As shown in Figure 5, three classes have been derived from one
base class. Feature A and Feature B of the base class are inherited in all the three derived classes.
Also, each derived class has added its own features according to the requirement.
Therefore, new classes use the concept of reusability and extend their functionality.
When a class acquire the property of another class is known as inheritance.
Inheritance is process of object reusability.
For example, A Child acquires property of Parents.
public class ParentClass
{
public ParentClass()
{
Console.WriteLine("Parent Constructor.");
}
public void print()
{
Console.WriteLine("I'm a Parent Class.");
}
}
public class ChildClass : ParentClass
{
public ChildClass()
{
Console.WriteLine("Child Constructor.");
}
public static void Main()
{
ChildClass child = new ChildClass();
15. Output:
Parent Constructor.
Child Constructor.
I'm a Parent Class.
Polymorphism:
Polymorphism means one name many forms.
One function behaves different forms.
In other words, "Many forms of a single object is called Polymorphism."
Real World Example of Polymorphism:
Example-1:
A Teacher behaves to student.
A Teacher behaves to his/her seniors.
Here teacher is an object but attitude is different in different situation.
Example-2:
Person behaves SON in house at the same time that person behaves EMPLOYEE in
office.
Example-3:
Your mobile phone, one name but many forms
As
As
As
As
phone
camera
mp3 player
radio
16. Difference between Abstraction and Encapsulation:Abstraction
Encapsulation
1. Abstraction solves the problem in the
1. Encapsulation solves the problem in the
design level.
implementation level.
2. Abstraction is used for hiding the
2. Encapsulation means hiding the code and
unwanted data and giving relevant data.
data into a single unit to protect the data from
outside world.
3. Abstraction lets you focus on what the
3. Encapsulation means hiding the internal
object does instead of how it does it
details or mechanics of how an object does
something.
4. Abstraction- Outer layout, used in terms
4. Encapsulation- Inner layout, used in
of design.
terms of implementation.
For Example:-
For Example:- Inner Implementation detail of
Outer Look of a Mobile Phone, like it has a
a Mobile Phone, how keypad button and
display screen and keypad buttons to dial a
Display Screen are connect with each other
number.
using circuits.
The easier way to understand Abstraction and encapsulation is as follows:Real World Example:Take an example of Mobile Phone:You have a Mobile Phone; you can dial a number using keypad buttons. Even you don't know
how these are working internally. This is called Abstraction. You have the only information that
is needed to dial a number. But not its internal working of mobile.
But how the Mobile Phone internally working?, how keypad buttons are connected with internal
circuit? is called Encapsulation.
17. BENEFITS OF OOPS
OOP offers several benefits to both the program developer and the user. The new technology provides
greater programmer productivity, better quality of software and lesser maintenance cost. The major
benefits are:
o
Ease in division of job: Since it is possible to map objects of the problem domain to
those objects in the program, the work can be easily partitioned based on objects.
o
Reduce complexity: Software complexity can be easily managed.
o
Provide extensibility: Object oriented systems can be easily upgraded from small to
large system.
o
Eliminate redundancy: Through inheritance we can eliminate redundant code and
extend the use of existing classes.
o
Saves development time and increases productivity: Instead of writing code from
scratch, solutions can be built by using standard working modules.
o
Allows building secure programs: Data hiding principle helps programmer to build
secure programs that cannot be accessed by code in other parts of the program.
o
Allows designing simpler interfaces: Message passing techniques between objects
allows making simpler interface descriptions with external systems.
Object Oriented Approach
18. The salient features of Object oriented programming are:
More emphasis is on data rather than procedure.
Programs are modularized into entities called objects.
Data structures methods characterize the objects of the problem.
Since the data is not global, there is no question of any operations other than those
defined within the object, accessing the data. Therefore, there is no scope of accidental
modification of data.
It is easier to maintain programs. The manner in which an object implements its
operations is internal to it. Therefore, any change within the object would not affect
external objects. Therefore, systems built using objects are resilient to change.
Object reusability, which can save many human hours of effort, is possible. An
application developer can use objects like „array‟, „list‟, „windows‟, „menus‟, „event‟ and
many other components, which were developed by other programmers, in her program
and thus reduce program development time.
It employs bottom-up approach in program design.
SUMMARY
OOP is a new way of organizing and developing programs. It eliminates many pitfalls of the
conventional programming approach. OOP programs are organized around objects, which
contain data and functions that operate on that data. A class is a template for a number of objects.
The object is an instance of a class. The major features of OOP are data abstraction, data
encapsulation, inheritance and polymorphism.
"Encapsulation is accomplished by using Class. - Keeping data and methods that accesses
that data into a single unit"
"Abstraction is accomplished by using Interface. - Just giving the abstract information
about what it can do without specifying the back ground details"
"Information/Data hiding is accomplished by using Modifiers - By keeping the instance
variables private or protected."
This new methodology increases programmer productivity, delivers better quality of software
and lessens maintenance cost. Languages that support several OOP concepts include C++,
Smalltalk, Object Pascal and Java.
19. �Check Your Progress 1
1) What do you understand by structured programming?
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
………
2) What is the basic idea of Object Oriented approach?
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
………
3) Differentiate between Data abstraction and data hiding.
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
……
4) Differentiate between Inheritance and polymorphism.
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
………
�Check Your Progress 2
1) State True or False.
a) In the procedure-oriented approach, all data are shared by all functions.
b) One of the major characteristics of OOP is the division of programs into objects that represent realworld entities.
c) Object Oriented programming language permit reusability of the existing code.
d) Data is given a second-class status in procedural programming approach.
20. e) OOP languages permit functional as well as data abstraction
2) Does procedure oriented language support the concept of class?
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
………
3) Give the reason of accessing data of a class through its functions only.
…………………………………………………………………………………
……..……………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
………
�Check Your Progress 3
1) State True or False
a) Protecting data from access by unauthorized functions is called data hiding.
b) Wrapping up of data of different types and functions into a unit is known as encapsulation.
c) Polymorphism can be used in implementing inheritance.
d) A Class permits us to build user-defined data types.
e) Object Oriented approach cannot be used to create databases.
2) Explain the advantage of dynamic binding.
…………………………………………………………………………………
…
…………………………………………………………………………………
…………………………………………………………………………………
3) Differentiate between object based and object oriented programming languages
……………………………………………………………………………
…………..………………………………………………………………
……………………………………………………………………………
……………………………………………………………………………
�SOLUTIONS/ANSWERS
Check Your Progress 1
21. 1) In structured programming, a program is divided into functions or modules and each module has a
clearly defined purpose and a defined interface to the other functions in the program. Dividing a program
into functions and modules is one of the major characteristics of structured programming. Here we are
least bothered about the data of the problem provided. Our main objective is to achieve control of the
execution of program correctly.
2) In Object Oriented programming (OOP), the program is organized around the data being operated
upon rather than the operations performed. The basic idea behind OOP is to combine both, data and its
functions that operate on the data into a single unit called object.
3) In data abstraction, data structures are used without having to be concerned about the exact details of
implementation. This insulation of the data from direct access by the other elements of the program is
known as data hiding. It is achieved through classes in OOPs.
4) Inheritance is the process by which objects of one class acquire the properties of objects of another
class in the hierarchy. By using inheritance, new classes can be built from the existing old classes. It
means that we can add additional features to an existing class without modifying it. This inheritance
mechanism allows the programmer to reuse a class that is almost, but not exactly, similar to the required
one by adding a few more features to it. Polymorphism means the ability to take more than one form with
the same name.
Using polymorphism we can have more than one function with the same name but with different
functionalities.
Check Your Progress 2
1) False. b) True. c) True. d) True. e) True.
2) Yes procedural languages also support the concept of class, for example, type (data type of the
language) is a class and is supported by procedural languages.You know C language support several data
types. But procedural languages don‟t support the user-defined class that has data and functions together.
3) Accessing data of a class through its functions is in basic philosophy of object orientation. If data is not
having restrictive access and open to all the principle of data hiding is violated and emphasis on data get
reduced.
Check Your Progress 3
22. 1) True. b) True. c) True. d) True. e) False.
2) It gives option of run-time selection of methods on the basis of current input during execution of
program. Dynamic binding allows new objects and code to be interfaced with or added to a system
without affecting existing code.
3) Object based languages support the notion of objects. Object oriented languages support the concept of
class and permit inheritance between classes.
�Multiple choice/objective type questions
1) Which language is not a true object-oriented programming language?
a.) VB.NET
b.) VB 6
c.) C++
d.) C#
e.) Java
Answer: b
2) A GUI:
a.) uses buttons, menus, and icons.
b.) should be easy for a user to manipulate.
c.) stands for Graphic Use Interaction.
d.) Both a and b.
e.) All of the above.
Answer: d
3) An object is composed of:
a.) properties.
b.) methods.
c.) events.
d.) Both a and b.
23. e.) All of the above.
Answer: e
4) Which statement about objects is true?
a.) One object is used to create one class.
b.) One class is used to create one object.
c.) One object can create many classes.
d.) One class can create many objects.
e.) There is no relationship between objects and classes.
Answer: d
5) Which is a numeric data type?
a.) Floating point
b.) Integer
c.) Boolean
d.) Both a and b.
e.) All of the above.
Answer: d
� Exercise
Questions and Answers
1.
What is the most important feature of Java?
Ans. Java is a platform independent language.
2. What do you mean by platform independence?
Ans. Platform independence means that we can write and compile the java code in one platform
(eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc).
3. What is a JVM?
24. Ans. JVM is Java Virtual Machine which is a run time environment for the compiled java class
files.
4. Are JVM's platform independent?
Ans. JVM's are not platform independent. JVM's are platform specific run time implementation
provided by the vendor.
5. What is the difference between a JDK and a JVM?
Ans. JDK is Java Development Kit which is for development purpose and it includes execution
environment also. But JVM is purely a run time environment and hence you will not be able to
compile your source files using a JVM.
6. What is a pointer and does Java support pointers?
Ans. Pointer is a reference handle to a memory location. Improper handling of pointers leads to
memory leaks and reliability issues hence Java doesn't support the usage of pointers.
Answer the following questions.
(Questions for short notes)
1. Can a private method of a super class be declared within a subclass?
2. Why Java does not support multiple inheritance?
3. In System.out.println (), what is System,out and println,pls explain?
4. What is meant by "Abstract Interface "?
5. Why Java does not support pointers?
6. What is the main difference between Java platform and other platforms?
(Questions for short Answer)
1. What is the base class of all classes?
2. Does Java support multiple inheritance?
3. Is Java a pure object oriented language?
4. Are arrays primitive data types?
5. What is difference between Path and Classpath?
6. What are local variables?
25. Reference
1. Gosling, James, A brief history of the Green project.[dead
link]
Java.net, no date
[ca.Q1/1998]. Retrieved April 29, 2007.
2. Gosling, James, A brief history of the Green project. anonymous-insider.net, no date [ca.
Q1/1998]. Retrieved September 4, 2013.
3. Gosling, James; Joy, Bill; Steele, Guy L., Jr.; Bracha, Gilad (2005). The Java Language
Specification (3rd ed.). Addison-Wesley. ISBN 0-321-24678-0.
4. Lindholm, Tim; Yelling, Frank (1999). The Java Virtual Machine Specification (2nd ed.).
Addison-Wesley. ISBN 0-201-43294-3.
5. "The History of Java Technology". Retrieved October 6, 2012.
6. Java 5.0 added several new language features C# language Gosling, James; and
McGilton, Henry (May 1996). "The Java Language Environment".
7. Gosling, James; Joy, Bill; Steele, Guy; and Bracha, Gilad. "The Java Language
Specification, 2nd Edition".
8. "The A-Z of Programming Languages: Modula-3". Computerworld.com.au. Retrieved
2010-06-09.
9. Tech Metrix Research (1999). "History of Java". Java Application Servers Report.
“Byous, Jon (ca. 1998)."Java technology: The early years". Sun Developer Network. Sun
Microsystems.
10. Object-oriented programming "The History of Java Technology". Sun Developer
Network. ca. 1995. Retrieved 2010-04-30.
11. "Java Community Process website". Jcp.org. 2010-05-24. Retrieved 2010-06-09.
12. "Learn About Java Technology". Oracle. Retrieved 21 November 2011.