In this page, we will learn about the basics of OOPs. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
In this page, we will learn about the basics of OOPs. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This document provides an overview of object-oriented programming concepts including abstraction, encapsulation, classes, objects, methods, constructors, inheritance, polymorphism, and interfaces. It explains that classes act as blueprints for objects, describing their data and behaviors. Objects are instances of classes that have state stored in attributes and behaviors defined by methods. Key features of OOP like inheritance, encapsulation, and polymorphism are discussed at a high level.
This document provides an overview of key object-oriented programming concepts in Java including classes, objects, encapsulation, inheritance, polymorphism, abstraction, interfaces, exception handling, and static methods. It includes examples of defining classes with properties and methods, creating objects, and using inheritance. Specific concepts like method overloading, overriding, and exception handling are demonstrated through code examples. The document also discusses data types, control statements, and static methods in Java.
This document covers the key concepts of object-oriented programming including classes, objects, properties, methods, abstraction, encapsulation, inheritance, and polymorphism. It discusses the advantages of OOP over structured programming and provides examples. The objectives of the session are to explain structured programming and its drawbacks, discuss OOP and its advantages, and define and describe the basic concepts of OOP.
C++ is an object-oriented programming language that is an incremented version of C with classes added. Some key differences between C and C++ are that C++ uses object-oriented programming with classes that can contain both data and functions, while C focuses more on procedures/functions and allows any function to access data. The document then discusses the basic concepts of object-oriented programming in C++ including classes, objects, polymorphism, inheritance, encapsulation, and data abstraction. It provides examples of classes, objects, reference variables, default arguments, and dynamic memory allocation in C++.
This document discusses object-oriented programming concepts in VB.NET, including:
- Classes define templates for objects with data and behaviors, while objects are instances of classes.
- Features like abstraction, encapsulation, and polymorphism are supported.
- Properties and methods represent object data and behaviors. Constructors and destructors manage object instantiation and cleanup.
- An example class defines properties and a constructor to initialize objects.
This document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like classes, objects, encapsulation, inheritance, and polymorphism. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems in the 1990s to be a platform-independent language for programming consumer electronics. The document outlines some of Java's key features like being simple, secure, portable, robust, and architecture-neutral. It also discusses Java's object-oriented nature and support for multithreading.
This document provides an overview of key Java concepts including data types, OOP concepts like inheritance and polymorphism, exception handling, collections, multithreading, design patterns, and Java 8 features. It defines Java as an object-oriented programming language and describes primitive and non-primitive data types. It also summarizes access modifiers, exception types, the difference between throw and throws, and the life cycle and states of threads.
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This document provides an overview of object-oriented programming concepts including abstraction, encapsulation, classes, objects, methods, constructors, inheritance, polymorphism, and interfaces. It explains that classes act as blueprints for objects, describing their data and behaviors. Objects are instances of classes that have state stored in attributes and behaviors defined by methods. Key features of OOP like inheritance, encapsulation, and polymorphism are discussed at a high level.
This document provides an overview of key object-oriented programming concepts in Java including classes, objects, encapsulation, inheritance, polymorphism, abstraction, interfaces, exception handling, and static methods. It includes examples of defining classes with properties and methods, creating objects, and using inheritance. Specific concepts like method overloading, overriding, and exception handling are demonstrated through code examples. The document also discusses data types, control statements, and static methods in Java.
This document covers the key concepts of object-oriented programming including classes, objects, properties, methods, abstraction, encapsulation, inheritance, and polymorphism. It discusses the advantages of OOP over structured programming and provides examples. The objectives of the session are to explain structured programming and its drawbacks, discuss OOP and its advantages, and define and describe the basic concepts of OOP.
C++ is an object-oriented programming language that is an incremented version of C with classes added. Some key differences between C and C++ are that C++ uses object-oriented programming with classes that can contain both data and functions, while C focuses more on procedures/functions and allows any function to access data. The document then discusses the basic concepts of object-oriented programming in C++ including classes, objects, polymorphism, inheritance, encapsulation, and data abstraction. It provides examples of classes, objects, reference variables, default arguments, and dynamic memory allocation in C++.
This document discusses object-oriented programming concepts in VB.NET, including:
- Classes define templates for objects with data and behaviors, while objects are instances of classes.
- Features like abstraction, encapsulation, and polymorphism are supported.
- Properties and methods represent object data and behaviors. Constructors and destructors manage object instantiation and cleanup.
- An example class defines properties and a constructor to initialize objects.
This document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like classes, objects, encapsulation, inheritance, and polymorphism. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems in the 1990s to be a platform-independent language for programming consumer electronics. The document outlines some of Java's key features like being simple, secure, portable, robust, and architecture-neutral. It also discusses Java's object-oriented nature and support for multithreading.
This document provides an overview of key Java concepts including data types, OOP concepts like inheritance and polymorphism, exception handling, collections, multithreading, design patterns, and Java 8 features. It defines Java as an object-oriented programming language and describes primitive and non-primitive data types. It also summarizes access modifiers, exception types, the difference between throw and throws, and the life cycle and states of threads.
The document provides an overview of object-oriented programming (OOP) fundamentals in .NET, including definitions and examples of key OOP concepts like objects, classes, encapsulation, inheritance, polymorphism, and design patterns. It discusses how objects are instances of classes, and how classes define attributes and behaviors. The document also covers class relationships like association and aggregation, and distinguishes between abstract classes and interfaces.
OOP is a programming paradigm that uses objects and classes to structure programs. Key concepts include classes, objects, methods, inheritance, abstraction, polymorphism, encapsulation. Popular OOP languages include Java, C++, C#, Python. OOP provides flexibility by allowing code reuse through inheritance and polymorphism. Classes define common properties and behaviors of objects through abstraction and encapsulation.
This document provides information about Java programming questions that are commonly asked in interviews and exams. It lists 30 Java programming questions and their answers on topics like OOPs concepts, multithreading, exceptions, JDBC, serialization and more. The document also provides links to connect with the authors on social media and messaging platforms like WhatsApp, Telegram, Facebook, Twitter etc. for any doubts or feedback. It reminds the reader to practice all the questions well to build a clear understanding of concepts and score well in exams.
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...Sagar Verma
OOPS and its application in Java, Super class AND This Keyword,Java Bean, POJO ,Memory management in Java ,Packages ,Miscellaneous (Var-Args, toString(), Double equals operator(==))
The document discusses object orientation and compares procedural and object-oriented programming. It defines key concepts in object-oriented programming like classes, objects, inheritance, encapsulation, and polymorphism. It also provides an example of a local class in ABAP with methods to retrieve and display data from database tables.
This document provides an introduction to Java and object-oriented programming concepts. It discusses how Java was designed to develop advanced software for network devices and systems. It then defines Java as an object-oriented programming language where code written to model real-world objects is called a class. The document also explains key object-oriented programming concepts like classes, objects, encapsulation, inheritance and polymorphism. It provides details on the object lifecycle of creation, usage and disposal in Java.
Java was conceived as a language for developing advanced software across a variety of network devices and systems. It draws influence from languages like C++ and aims to provide a platform for developing secure, high-performance, robust applications across multiple platforms in distributed networks. Java uses object-oriented programming, with classes and objects modeling real-world entities. A Java program consists of classes with fields and methods, and it must contain a main method where execution begins. Variables are used to store and manipulate data in a program.
Object-oriented programming (OOP) involves splitting a program into objects that contain both data and functions. OOP allows developers to define objects, their properties, and relationships. Classes are blueprints that define objects and don't use memory, while objects are instances of classes that hold both data and methods. Key concepts of OOP include inheritance, abstraction, polymorphism, and encapsulation.
The document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like abstraction, encapsulation, inheritance, polymorphism and classes. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems to develop software for consumer electronics but was later targeted towards internet programming. The document also lists some of Java's key characteristics like being simple, secure, portable, object-oriented, robust and multithreaded.
The document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like abstraction, encapsulation, inheritance, polymorphism and classes. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems to develop software for consumer electronics but was later targeted towards internet programming. The document also lists some of Java's key characteristics like being simple, secure, portable, object-oriented, robust and multithreaded.
This document discusses the syllabus for the course IT1301 - Object Oriented Programming. It covers key concepts in OOP like classes, objects, inheritance, polymorphism, abstraction and encapsulation. It also discusses features of Java like being platform independent, secure, robust etc. The document contains examples and questions related to OOP concepts in Java. Constructors and their types, access specifiers, object class and reflection are explained in detail with examples. Creation and accessing of user-defined packages in Java is also discussed.
Ideal for learning the basics of java, and can also be used as a school project for class 10 and 12. The document contains illustrative pictures, and carefully selected information to make the basics of java strong. Pls ignore small spelling mistakes made.
This document provides a syllabus for a Java programming course including:
- 7 topics that will be covered ranging from Java fundamentals to database connectivity.
- A practical exam worth 50 marks involving 10 programming assignments.
- 12 programming assignments that will be completed as part of the term work.
- 4 references books that will be used for the course.
This presentation provides an introduction to Java programming, covering key concepts like object-oriented programming (OOP) principles of objects, classes, inheritance, polymorphism, abstraction, and encapsulation. It also discusses Java features like platform independence and portability. Additionally, it defines common Java elements like data types, variables, methods, constructors, and operators.
Object-oriented programming organizes software around data objects rather than functions. The key concepts are encapsulation, inheritance, and polymorphism. Encapsulation treats an object's data and methods as a single unit, inheritance creates class hierarchies where subclasses inherit attributes and behaviors from parent classes, and polymorphism allows the same method to work differently for different classes. The main building blocks are classes, which act as templates for objects, and methods, which define objects' behaviors.
Top 371 java fa qs useful for freshers and experiencedGaurav Maheshwari
The document discusses differences between abstract classes and interfaces in Java. It provides 7 key differences: 1) Abstract classes can have executable and unimplemented methods while interfaces only contain method signatures. 2) A class can implement multiple interfaces but extend only one abstract class. 3) Abstract classes can have non-abstract methods and variables while interfaces cannot. 4) Abstract classes can define constructors while interfaces cannot. 5) Abstract classes can have any visibility modifier while interfaces must be public or package-private. 6) Abstract classes inherit from Object while interfaces do not.
Java Faqs useful for freshers and experiencedyearninginjava
1. The document discusses the differences between abstract classes and interfaces in Java. Abstract classes can contain implemented methods while interfaces contain no implementation code. A class can extend only one abstract class but implement multiple interfaces.
2. It defines checked and unchecked exceptions in Java. Checked exceptions must be caught or declared to be thrown, while unchecked exceptions like NullPointerException do not require handling.
3. User-defined exceptions can be created by extending the Exception class and using throw statements. The throw statement signals the exception and catch handles it.
This document provides an overview of object-oriented programming (OOP). It discusses procedural programming and how it differs from OOP. The main features/principles of OOP are data abstraction, inheritance, encapsulation, and polymorphism. Advantages of OOP include promoting code reuse and flexibility through polymorphism. Key terms are defined, including class, object, properties, and methods. A class defines the blueprint for an object, while an object is an instance of a class that occupies memory.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
More Related Content
Similar to In this page, we will learn about the basics of OOPs. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
The document provides an overview of object-oriented programming (OOP) fundamentals in .NET, including definitions and examples of key OOP concepts like objects, classes, encapsulation, inheritance, polymorphism, and design patterns. It discusses how objects are instances of classes, and how classes define attributes and behaviors. The document also covers class relationships like association and aggregation, and distinguishes between abstract classes and interfaces.
OOP is a programming paradigm that uses objects and classes to structure programs. Key concepts include classes, objects, methods, inheritance, abstraction, polymorphism, encapsulation. Popular OOP languages include Java, C++, C#, Python. OOP provides flexibility by allowing code reuse through inheritance and polymorphism. Classes define common properties and behaviors of objects through abstraction and encapsulation.
This document provides information about Java programming questions that are commonly asked in interviews and exams. It lists 30 Java programming questions and their answers on topics like OOPs concepts, multithreading, exceptions, JDBC, serialization and more. The document also provides links to connect with the authors on social media and messaging platforms like WhatsApp, Telegram, Facebook, Twitter etc. for any doubts or feedback. It reminds the reader to practice all the questions well to build a clear understanding of concepts and score well in exams.
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...Sagar Verma
OOPS and its application in Java, Super class AND This Keyword,Java Bean, POJO ,Memory management in Java ,Packages ,Miscellaneous (Var-Args, toString(), Double equals operator(==))
The document discusses object orientation and compares procedural and object-oriented programming. It defines key concepts in object-oriented programming like classes, objects, inheritance, encapsulation, and polymorphism. It also provides an example of a local class in ABAP with methods to retrieve and display data from database tables.
This document provides an introduction to Java and object-oriented programming concepts. It discusses how Java was designed to develop advanced software for network devices and systems. It then defines Java as an object-oriented programming language where code written to model real-world objects is called a class. The document also explains key object-oriented programming concepts like classes, objects, encapsulation, inheritance and polymorphism. It provides details on the object lifecycle of creation, usage and disposal in Java.
Java was conceived as a language for developing advanced software across a variety of network devices and systems. It draws influence from languages like C++ and aims to provide a platform for developing secure, high-performance, robust applications across multiple platforms in distributed networks. Java uses object-oriented programming, with classes and objects modeling real-world entities. A Java program consists of classes with fields and methods, and it must contain a main method where execution begins. Variables are used to store and manipulate data in a program.
Object-oriented programming (OOP) involves splitting a program into objects that contain both data and functions. OOP allows developers to define objects, their properties, and relationships. Classes are blueprints that define objects and don't use memory, while objects are instances of classes that hold both data and methods. Key concepts of OOP include inheritance, abstraction, polymorphism, and encapsulation.
The document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like abstraction, encapsulation, inheritance, polymorphism and classes. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems to develop software for consumer electronics but was later targeted towards internet programming. The document also lists some of Java's key characteristics like being simple, secure, portable, object-oriented, robust and multithreaded.
The document provides an overview of object-oriented programming concepts and Java programming. It discusses key OOP concepts like abstraction, encapsulation, inheritance, polymorphism and classes. It then covers the history and development of Java, describing how it was initially created at Sun Microsystems to develop software for consumer electronics but was later targeted towards internet programming. The document also lists some of Java's key characteristics like being simple, secure, portable, object-oriented, robust and multithreaded.
This document discusses the syllabus for the course IT1301 - Object Oriented Programming. It covers key concepts in OOP like classes, objects, inheritance, polymorphism, abstraction and encapsulation. It also discusses features of Java like being platform independent, secure, robust etc. The document contains examples and questions related to OOP concepts in Java. Constructors and their types, access specifiers, object class and reflection are explained in detail with examples. Creation and accessing of user-defined packages in Java is also discussed.
Ideal for learning the basics of java, and can also be used as a school project for class 10 and 12. The document contains illustrative pictures, and carefully selected information to make the basics of java strong. Pls ignore small spelling mistakes made.
This document provides a syllabus for a Java programming course including:
- 7 topics that will be covered ranging from Java fundamentals to database connectivity.
- A practical exam worth 50 marks involving 10 programming assignments.
- 12 programming assignments that will be completed as part of the term work.
- 4 references books that will be used for the course.
This presentation provides an introduction to Java programming, covering key concepts like object-oriented programming (OOP) principles of objects, classes, inheritance, polymorphism, abstraction, and encapsulation. It also discusses Java features like platform independence and portability. Additionally, it defines common Java elements like data types, variables, methods, constructors, and operators.
Object-oriented programming organizes software around data objects rather than functions. The key concepts are encapsulation, inheritance, and polymorphism. Encapsulation treats an object's data and methods as a single unit, inheritance creates class hierarchies where subclasses inherit attributes and behaviors from parent classes, and polymorphism allows the same method to work differently for different classes. The main building blocks are classes, which act as templates for objects, and methods, which define objects' behaviors.
Top 371 java fa qs useful for freshers and experiencedGaurav Maheshwari
The document discusses differences between abstract classes and interfaces in Java. It provides 7 key differences: 1) Abstract classes can have executable and unimplemented methods while interfaces only contain method signatures. 2) A class can implement multiple interfaces but extend only one abstract class. 3) Abstract classes can have non-abstract methods and variables while interfaces cannot. 4) Abstract classes can define constructors while interfaces cannot. 5) Abstract classes can have any visibility modifier while interfaces must be public or package-private. 6) Abstract classes inherit from Object while interfaces do not.
Java Faqs useful for freshers and experiencedyearninginjava
1. The document discusses the differences between abstract classes and interfaces in Java. Abstract classes can contain implemented methods while interfaces contain no implementation code. A class can extend only one abstract class but implement multiple interfaces.
2. It defines checked and unchecked exceptions in Java. Checked exceptions must be caught or declared to be thrown, while unchecked exceptions like NullPointerException do not require handling.
3. User-defined exceptions can be created by extending the Exception class and using throw statements. The throw statement signals the exception and catch handles it.
This document provides an overview of object-oriented programming (OOP). It discusses procedural programming and how it differs from OOP. The main features/principles of OOP are data abstraction, inheritance, encapsulation, and polymorphism. Advantages of OOP include promoting code reuse and flexibility through polymorphism. Key terms are defined, including class, object, properties, and methods. A class defines the blueprint for an object, while an object is an instance of a class that occupies memory.
Similar to In this page, we will learn about the basics of OOPs. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc. (20)
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
Your Skill Boost Masterclass: Strategies for Effective Upskilling
In this page, we will learn about the basics of OOPs. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
2. A Simple Approach-Core Java / Session 4/ 2 of 34
Aptech Software Ltd.
Review
Java has built-in data types, known as primitive data types.
Variables are basic units of storage.
Casting is a facility of converting a data type to another data type.
Arrays are used to store several items of same data type in consecutive
memory locations.
Java provides different types of operators. They include:
Arithmetic
Relational
Logical
Conditional
Assignment
Java supports the following programming constructs for the control
statements:
if - else
switch
for
while
do - while
The two jump statements, break and continue, helps to transfer control to
another part of the program.
3. A Simple Approach-Core Java / Session 4/ 3 of 34
Aptech Software Ltd.
Objectives
Explain Object
Explain Class
Explain abstraction and encapsulation
Explain the relationship between Object and
Class
Design an example to create class and object
Describe components of a class
4. A Simple Approach-Core Java / Session 4/ 4 of 34
Aptech Software Ltd.
Object Oriented Programming
All real world things
are considered as
objects in OOP
Enables modeling of real world
entities into similar entities
using a computer
Method of designing and
implementing software systems
Designed to model real world
concepts using a computer program
OOP
5. A Simple Approach-Core Java / Session 4/ 5 of 34
Aptech Software Ltd.
Object
Object
Core of Object
oriented
programming
Represents an entity
in the real world
Provides practical
basis for computer
applications
Accomplishes
specific tasks
“An object is a concrete entity that exists and which
has a well defined state and behavior.”
6. A Simple Approach-Core Java / Session 4/ 6 of 34
Aptech Software Ltd.
Example of an Object
Customer Object
Cashier Object
State
Behavior
7. A Simple Approach-Core Java / Session 4/ 7 of 34
Aptech Software Ltd.
Message Passing
“A message is a request sent by one object to
another object to carry out certain actions.”
Message Passing
When a particular operation is
to be performed, it is
requested for by sending a
message to the object for
which the operation is define
Objects communicate with
each other by passing
messages
8. A Simple Approach-Core Java / Session 4/ 8 of 34
Aptech Software Ltd.
Class
A Class defines an entity in terms of common
characteristics and actions.
Class is a mechanism used to group properties of
actions common to various objects.
Class of Shapes
Class of Animals
Class of Cars
Examples of Classes
“A class is a blueprint for a group of objects that have
common properties and behavior.”
9. A Simple Approach-Core Java / Session 4/ 9 of 34
Aptech Software Ltd.
Example of Class and Object
Stock
Manager
System
Administrator
Salesman Purchase
Manager
Cashier
Employee
class
object object
object object object
10. A Simple Approach-Core Java / Session 4/ 10 of 34
Aptech Software Ltd.
Properties or Attributes
Characteristics of objects represented as variables in a
class.
Each object has its own value for each of its properties.
The property names are shared by all instances of a
class.
Address
Name
Salesman Object
Properties
Age
“A characteristic possessed by an object or entity when
represented in a class is called a property.”
11. A Simple Approach-Core Java / Session 4/ 11 of 34
Aptech Software Ltd.
Methods
Methods
Specification of how the
requested operation is
carried out
Methods specify the manner
in which the data of an
object is manipulated
Actual implementation
of an operation
“An action performed by an object is known as a
method.”
12. A Simple Approach-Core Java / Session 4/ 12 of 34
Aptech Software Ltd.
Example of Method
stitchClothes
Steps
for
stitching
clothes
Take
Measurement
Get
Instruments
Stitch
clothes
Method
13. A Simple Approach-Core Java / Session 4/ 13 of 34
Aptech Software Ltd.
Difference between Class and Objects
Class defines
an entity
Object is the
actual entity
Class is a conceptual model
that defines all the
characteristics and
actions required of an
object
Class and Objects
All objects belonging to
the same class have
the same
characteristics and
actions
14. A Simple Approach-Core Java / Session 4/ 14 of 34
Aptech Software Ltd.
Encapsulation
Information Hiding
Hiding implementation details of an object from its user
Packing things together and presenting them in their new
integrated form.
For example, two or more chemicals form a capsule
Packing the methods and attributes together in a single
unit.
Units are implemented in the form of classes
“The process of hiding attributes, methods or details
of implementation is called Encapsulation.”
16. A Simple Approach-Core Java / Session 4/ 16 of 34
Aptech Software Ltd.
Example of Encapsulation 3-1
Auti Ltd. Buto Ltd.
Ms Samanta
Marketing Manager
Mr. James
Purchase Manager
Requirements
Interfaces
17. A Simple Approach-Core Java / Session 4/ 17 of 34
Aptech Software Ltd.
Example of Encapsulation 3 - 2
Auti Ltd. Buto Ltd.
PUBLIC
Phone No
E-mail Id
Catalog of Products
PRIVATE
How spare parts are manufactured
Stock of spare parts
Cost for creating spare parts
PUBLIC
Phone No
E-mail Id
Catalog of Cars
PRIVATE
How cars are assembled
Stock of cars
Cost for assembling cars
Selective Availability of Data
18. A Simple Approach-Core Java / Session 4/ 18 of 34
Aptech Software Ltd.
Example of Encapsulation 3 - 3
Entity Auti Ltd
. EntityButo Ltd.
Auti Ltd. Buto Ltd.
PROPERTIES
Phone No
E- mail Id
Catalog of Products
Current Stock Quantity
Employee details
Material required details
METHODS
Receive Orders
How spare parts are manufactured
Calculating cost for creating spare
parts
Calculating profit margin
PROPERTIES
Phone No
E- mail Id
Catalog of Cars
Car Specifications
Employee Details
Stock details
Dealers details
METHODS
Place Orders
How cars are assembled
Calculating cost for assembling cars
Calculating salaries
Placing an order
Creating necessary reports
19. A Simple Approach-Core Java / Session 4/ 19 of 34
Aptech Software Ltd.
Abstraction
Technique of
dealing with
the complexity
of an object.
Focussing only on
the essential
details and
overlooking the
non-essential
details of an
object.
20. A Simple Approach-Core Java / Session 4/ 20 of 34
Aptech Software Ltd.
Example of Abstraction
Hands over report
Carrier Courier
Company
Gets
acknowledgement
receipt signed
Hands over
acknowledgement
receipt
Dr. Smith
Report sent to
destination
Report is packed
and sealed
21. A Simple Approach-Core Java / Session 4/ 21 of 34
Aptech Software Ltd.
Data Abstraction
Concept of abstraction applied to the attributes
(data) of a class.
Implemented in programming languages using
Abstract Data Types (ADT).
“The process of identifying and grouping attributes
and actions related to a particular entity as
relevant to the application is Data Abstraction.”
22. A Simple Approach-Core Java / Session 4/ 22 of 34
Aptech Software Ltd.
Example of Data Abstraction
Attributes
Name
Roll Number
Seat Number
Ranking
Methods
GiveExam()
AttendClasses()
FillExamForm()
Class Student
23. A Simple Approach-Core Java / Session 4/ 23 of 34
Aptech Software Ltd.
Implementing Classes in Java
Syntax
class <classname> {
<body of the class>
}
where,
class is the keyword used for creating a class,
<classname> is the name of the class, and
<body of the class> consists of declaration
of attributes and methods.
24. A Simple Approach-Core Java / Session 4/ 24 of 34
Aptech Software Ltd.
Methods in classes 5-1
Method
Definition
Name of the
method
List of
parameters
Body of the
method
Type of object
or primitive
type that
the method
returns
25. A Simple Approach-Core Java / Session 4/ 25 of 34
Aptech Software Ltd.
Methods in classes 5-2
Syntax
<returntype> <methodname> (<type1> <arg1>,
<type2> <arg3,…) {
<set of statements>
}
where,
returntype is the data type of the value returned by
the method,
<methodname> is the user-defined name of the method,
and method’s parameter list is a set of variable
declarations.
26. A Simple Approach-Core Java / Session 4/ 26 of 34
Aptech Software Ltd.
Methods in Classes 5-3
class Book {
String bookName;
String authorName;
int nopages;
boolean available;
void isAvailable() {
if(available == true)
System.out.println("The Book is
available");
}
…
method
27. A Simple Approach-Core Java / Session 4/ 27 of 34
Aptech Software Ltd.
Methods in Classes 5-4
Methods are accessed using dot notation.
Object whose method is called is on the left of
the dot, while the name of the method is on the
right.
For Example,
Obj.isAvailable();
Java provides class methods, which are similar
to instance methods.
Class method declaration is preceded with a
static keyword.
28. A Simple Approach-Core Java / Session 4/ 28 of 34
Aptech Software Ltd.
Methods in Classes 5-5
class Book {
String bookName;
String authorName;
int nopages;
boolean available;
}
Book objBook = new Book();
objBook.isAvailable();
….. Dot notation
static void isAvailable() {
if(available == true)
System.out.println("The Book
is available");
}
29. A Simple Approach-Core Java / Session 4/ 29 of 34
Aptech Software Ltd.
this Keyword
Used inside any instance method to refer to the
current object.
The value of this refers to the object on which
the current method has been called.
The this keyword can be used where a
reference to an object of the current class type is
required.
30. A Simple Approach-Core Java / Session 4/ 30 of 34
Aptech Software Ltd.
Example of this Keyword
class pixel {
int x,y;
void init (int x, int y)
{
this.x = x;
this.y = y;
}
}
public static void main (String args[])
{
pixel p = new pixel();
p.init (4,3);
}
The program initializes x = 4 and y = 3.
Reference to an
object
31. A Simple Approach-Core Java / Session 4/ 31 of 34
Aptech Software Ltd.
Constructors 4-1
Method invoked whenever an instance of a
given class is created.
Same name as the class and no return type.
Java allocates memory for the object, initializes
the instance variables and calls the constructor
methods.
Two types of constructors
Parameterized constructors
Implicit constructors
32. A Simple Approach-Core Java / Session 4/ 32 of 34
Aptech Software Ltd.
Example of Parameterized Constructors
Sdate(int m,int d,int y) {
month=m;
day=d;
year=y;
System.out.println("The Date is " + m + "/" + d
+ "/" + y + ".");
}
public static void main(String args[])
{
Sdate S1,S2;
S1=new Sdate(11,27,1969);
S2=new Sdate(3,3,1973);
}
Parameterized
Constructor
Constructors 4-2
33. A Simple Approach-Core Java / Session 4/ 33 of 34
Aptech Software Ltd.
Example of Implicit Constructors
Sdate()
{
month=11;
day=27;
year=1969;
}
public static void main(String args[])
{
Sdate S1,S2;
S1=new Sdate();
S2=new Sdate();
}
Implicit Constructors
Constructors 4-3
34. A Simple Approach-Core Java / Session 4/ 34 of 34
Aptech Software Ltd.
Constructors 4-4
Demonstrate: Example 1
public static void main(String[] args) {
Book objBook = new Book("CoreJava",
"Albert", 45, true)
User objUser = new User();
objUser.getBookStatus(objBook);
}
Book(String book, String author, int
pages, boolean status) {
bookName = book;
authorName = author;
nopages = pages;
available = status;
}
class User {
void getBookStatus(Book objBook) {
objBook.isAvailable();
}
}
35. A Simple Approach-Core Java / Session 4/ 35 of 34
Aptech Software Ltd.
Summary
An object consists of state and a behavior.
A class acts as a blueprint for a group of objects that
have the same properties and behavior.
Abstraction is ignoring the data that is not required and
concentrating only on data relevant to the application.
Encapsulation is the process of hiding the
implementation details of an object from its user.
The variables and methods of a class are accessed by
the instances of that class.
Dot notation is used to access members of an object.
A constructor initializes an object when created.