This document discusses object-oriented programming and compares old procedural programming techniques using structures to the newer object-oriented approach using classes. Specifically:
- Old programming used structures to define data types and separate functions to operate on those structures.
- The new object-oriented approach defines classes that encapsulate both the data structure and functions together as objects.
- Some key benefits of the object-oriented approach are that new types of objects can be added without changing existing code, and that new objects can inherit features from existing objects, making the code easier to modify.
oops concept in java | object oriented programming in javaCPD INDIA
object oriented programming is a key concept for the development of application in windows as well as web based application environment. oops concept maps real world through its concept of classes, objects, inheritance, polymorphism which help in making a robust application.
oops concept in java | object oriented programming in javaCPD INDIA
object oriented programming is a key concept for the development of application in windows as well as web based application environment. oops concept maps real world through its concept of classes, objects, inheritance, polymorphism which help in making a robust application.
Our trainer’s having vast experience in real time environment. If anyone has a dream for their career in software programming, then go for java because it is a popular route to establish and fulfill your dreams.
We offer the best quality and affordable training, so you get trained from where you are, from our experienced instructors, remotely using Webex / Gotomeeting.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
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.
Abstraction, Encapsulation, Polymorphism, and Interfaces: whether you've been programming in PHP for years or are just starting your journey, these terms can be overwhelming even on a good day. Variables, conditionals, those all make sense. But this whole Object-Oriented thing is WAY more complicated. Not only that, people that already understand it act like it's so easy and they talk right over the simple questions and never explain the basic concepts in a way that actually makes sense. In this session we'll take you through real life examples of Object-Oriented terminology in a way that will make sense of all the mumbo jumbo and allow you to utilizing OOP immediately.
Abstraction, encapsulation, polymorphism, and interfaces: whether you've been programming in PHP for years or are just starting your journey, these terms can be overwhelming even on a good day. Variables, conditionals, those all make sense. But this whole object-oriented thing is way more complicated. Not only that, people that already understand it, act like it's so easy and they talk right over the simple questions and never explain the basic concepts in a way that actually makes sense. In this session, we'll take you through real-life examples of object-oriented terminology in a way that will make sense of all the mumbo jumbo and allow you to utilize object-oriented programming (OOP) immediately.
Our trainer’s having vast experience in real time environment. If anyone has a dream for their career in software programming, then go for java because it is a popular route to establish and fulfill your dreams.
We offer the best quality and affordable training, so you get trained from where you are, from our experienced instructors, remotely using Webex / Gotomeeting.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
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.
Abstraction, Encapsulation, Polymorphism, and Interfaces: whether you've been programming in PHP for years or are just starting your journey, these terms can be overwhelming even on a good day. Variables, conditionals, those all make sense. But this whole Object-Oriented thing is WAY more complicated. Not only that, people that already understand it act like it's so easy and they talk right over the simple questions and never explain the basic concepts in a way that actually makes sense. In this session we'll take you through real life examples of Object-Oriented terminology in a way that will make sense of all the mumbo jumbo and allow you to utilizing OOP immediately.
Abstraction, encapsulation, polymorphism, and interfaces: whether you've been programming in PHP for years or are just starting your journey, these terms can be overwhelming even on a good day. Variables, conditionals, those all make sense. But this whole object-oriented thing is way more complicated. Not only that, people that already understand it, act like it's so easy and they talk right over the simple questions and never explain the basic concepts in a way that actually makes sense. In this session, we'll take you through real-life examples of object-oriented terminology in a way that will make sense of all the mumbo jumbo and allow you to utilize object-oriented programming (OOP) immediately.
This is a Introduction to Object Oriented (OO) Concepts, Java Programming Language and leveraging Eclipse (IBM WebSphere) to develop Java applications.
This is based on JDK 1.4 concepts/features. A newer version maybe provided at a future date.
This is the object oriented lecture nmbr 3rd , if you want lecture 2 or 1 u can check it my account , this is the programing tutorial, please follow me and thank you
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
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.
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.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
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.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
2. Old Programming Technique:
Structures
struct queue{
int a[5];
int head;
int tail;
};
struct stack{
int a[5];
int top;
}
void main()
{
struct queue Q;
struct stack S;
print( Q.a[2] );
print( S.a[2] );
add(S, 3);
add(Q, 2);
}
void add(queue Z, int x){
<codes for
adding queue
elements here>
}
void remove(queue Z, int x){
<codes for
removing queue
elements here>
}
void add(stack Z, int x){
<codes for
adding stack
elements here>
}
void remove(stack Z, int x){
<codes for
removing stack
elements here>
}
?
3. New Programming Technique:
Object-Oriented
void main()
{
queue Q;
stack S;
print( Q.a[2] );
print( S.a[2] );
S.add(3);
Q.add(2);
}
class queue{
int a[5];
int head;
int tail;
void add(int x){
<codes here>
}
void remove(int x){
<codes here>
}
};
class stack{
int a[5];
int top;
void add(int x){
<codes here>
}
void remove(int x){
<codes here>
}
}
4. Chapter 3 - Object-Orientation
What is OO Programming
A type of programming in which programmers define not only
the data type of a data structure, but also the types of
operations (functions) that can be applied to the data structure.
In this way, the data structure becomes an object that includes
both data and functions.
In addition, programmers can create relationships between one
object and another.
For example, objects can inherit characteristics from other
objects.
6. Object-orientation is a new technology based on objects and
classes. It presently represents the best methodological framework
for software designers to develop complex large scale systems.
One of the principal advantages of object-oriented programming
techniques over procedural programming techniques is that they
enable programmers to create modules that do not need to be
changed when a new type of object is added.
A programmer can simply create a new object that inherits
many of its features from existing objects. This makes object-
oriented programs easier to modify.
Chapter 3 - Object-Orientation
What is OOP?
9. What is a Class?
In manufacturing, a blueprint is a description of a device
from which many physical devices are constructed
In software, a class is a description of an object
A class describes the data that each object includes
A class describes the behaviour that each object
exhibit
In Java, classes support three key features of OOP
encapsulation
inheritance
polymorphism
Chapter 3 - Object-Orientation
10. What is an Object?
An object is an instance of the class. Objects store data
and provides method for accessing and modifying this data
Chapter 3 - Object-Orientation
data/properties/fields – are the attributes of the object
methods – are functions that manipulate the data
Class:
Vehicle
Blue Print
Object: Actual Auto
Object: Actual Bus
Object: Actual Jeep
15. Chapter 3 - Object-Orientation
Constructors
•Constructors are useful for initializing objects before they
are being used.
•Parameters can be passed to the constructor in the
same way as for a method.
•Constructors are special purpose methods;
•a constructor is only used during instantiation to initialize
the object and is never used again.
•A constructor must follow the following rules:
1. A constructor's name must be the name of the class.
2. A constructor does not have any return type.
16. Chapter 3 - Object-Orientation
Constructors
Syntax:
<modifier> <classname>(parameters){
<statements>
}
Example:
String school = new String(“JAVA University”);
String school = new String( );
17. Instantiating a Class
• Creating Objects:
<class name> <object name> = new <constructor call>;
String school = new String(“JAVA University”);
18. Chapter 3 - Object-Orientation
Accessing Object Members:
The “dot” notation <object>.<member>
This is used to access object members including
attributes and methods
Examples:
thing1.setX(47);
thing1.x=47; // valid only if x is public
21. JAVA PACKAGES
The standard Java classes are organized into packages.
Packages are a way of grouping related classes to avoid
potential naming conflicts.
The standard Java packages are
java.lang java.awt
java.applet java.awt.image
java.awt.peer java.io
java.net java.util
22. Chapter 3 - Object-Orientation
Package
Class1 Class 2 Class 3 Class n
Attributes
Methods
Attributes
Methods
Attributes
Methods
Attributes
Methods
24. Chapter 3 - Object-Orientation
java.lang package
--- contains the various classes that are essential to the
definition of the Java language or that, by their nature, need
to access the internals of Java in a way that most classes
cannot do.
Java.lang classes:
Boolean, Byte, Character, Character.Subset,
Character.UnicodeBlock, Class, ClassLoader
Compiler, Double, Float, InheritableThreadLocal
Integer, Long, Math, Number, Object, Package, Process
Runtime, RuntimePermission, SecurityManager, Short
String, StringBuffer, System, Thread, ThreadGroup
ThreadLocal, Throwable and Void
26. Chapter 3 - Object-Orientation
Java.lang
package
Class String
charAt(int index)
int compareTo(Object o)
int compareTo(String anotherString)
int compareToIgnoreCase(String str)
String concat(String str)
static String copyValueOf(char[] data)
static String copyValueOf(char[] data, int offset, int count)
boolean endsWith(String suffix)
boolean equals(Object anObject)
booleanequalsIgnoreCase(String anotherString)
byte[] getBytes()
void getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)
27. Chapter 3 - Object-Orientation
Methods of Class String of the java.lang package
• public int length()
• public char charAt(int index)
• public String substring(int beginIndex, int endIndex)
To create an instance of String:
String proglang = “JAVA”;
To use method length:
x = proglang.length();
30. Chapter 3 - Object-Orientation
Encapsulation
•Is the process of compartmentalizing the elements of an
abstraction that constitute its structure and behavior
•It is achieved through information hiding, which is the
process of hiding all the secrets of an object that do not
contribute to its essential characteristics; typically the structure
of an object is hidden, as well as the implementation of the
methods.
•Forces the user to use an interface to access data
•Makes the code more maintainable
31. Chapter 3 - Object-Orientation
Information Hiding
- is the process of hiding details of an object/function.
-is designing a method so that it can be used without
any need to understand the fine detail of the code.
- An object is composed of a public interface and a
private section that can be a combination of internal
data and methods. The internal data and methods are
the sections of the object hidden.
-The primary benefit is that these sections can change
without affecting other parts of the program
ABSTRACTION & ENCAPSULATION
BENEFITS OF ENCAPSULATION
32. Chapter 3 - Object-Orientation
ABSTRACTION & ENCAPSULATION
• Modularity. This means that an object can be maintained
independently of other objects. Because the source code for
the internal sections of an object is maintained separately from
the interface, you are free to make modifications with
confidence that your object won't cause problems to other
areas. This makes it easier to distribute objects throughout a
system.
BENEFITS OF ENCAPSULATION
33. Chapter 3 - Object-Orientation
Method and Member Visibility
Encapsulation hides a class internal details for the outside
world; if we were to provide getter and setter methods but
leave Account class member declaration as public
This is because public allows virtually any one to access
the member. By using private, we have effectively closed
all members to the outside world.
By doing this, we are enforcing encapsulation.
ABSTRACTION & ENCAPSULATION
34. Chapter 3 - Object-Orientation
Java provides the following visibility keywords which can be
used on members or methods:
public A method or member that is declared public is
accessible from any class.
protected A method or member that is declared protected
is accessible only to its subclass and the class itself.
private A private method or member of a class is only
accessible from within that class. Other classes including
subclass cannot access this member or method.
Keyword Self Subclass Others
Public yes yes yes
Protected yes yes no
Private yes no no
ABSTRACTION & ENCAPSULATION
35. Declaring Java
Classes:
public class Thing{
public int x;
Thing (); //we dnt nd
}
public class TestThing{
public static void main(String args[]{
Thing thing1 = new Thing();
thing1.x = 47;
System.out.println(“Thing1 = “+
thing1.x);
}
}
Instantiating a
Class:
36. Declaring Java
Classes:
public class Thing{
private int x;
public int getter(){
return x;
}
public void setter(int newx){
x = newx;
}
}
Public class TestThing{
public static void main(String args[]{
Thing thing1 = new Thing();
thing1.x = 47; // invalid
thing1.setter(47);
System.out.println(“Thing1 = “
+ thing1.getter();
}
}
Instantiating a
Class:
38. Chapter 3 - Object-Orientation
Abstraction
denotes the essential characteristics of an object that distinguish
it from all other kinds of objects focuses on the outside view of
the object
Kinds of Abstraction
Entity abstraction – an object that represents a useful model
of a problem-domain or solution domain.
Action Abstraction – an object that provides a generalized set
of operations, all of which perform the same kind of functions.
42. Declaring Java
Classes:
public class Thing{
public int x;
}
public class TestThing{
public static void main(String args[]{
Thing thing1 = new Thing();
thing1.x = 47;
System.out.println(“Thing1 = “+ thing1.x);
}
}
43. Declaring Java
Classes:
public class Thing{
private int x;
public int getX(){
return x;
}
public void setX(int newx){
x = newx;
}
}
Public class TestThing{
public static void main(String args[]{
Thing thing1 = new Thing();
thing1.setX(47);
System.out.println(“Thing1 = “
+ thing1.getX();
}
}
Instantiating a
Class:
44. Chapter 3 - Object-Orientation
Accessing Object Members:
The “dot” notation <object>.<member>
This is used to access object members including
attributes and methods
Examples:
thing1.setX(47)
thing1.x=47; // valid only if x is public
46. Chapter 3 - Object-Orientation
public class Account3 {
private String name;
private int acctNo;
private float balance;
private boolean overdraft;
public Account3(String n, int no) {
name = n;
acctNo = no;
balance = 4000F;
overdraft = false;
}
public void deposit(float amt) { ---- }
public void withdrawal(float amt) { ---- }
public void transfer(Account from, float amt) { ---- }
Information Hiding
ABSTRACTION & ENCAPSULATION
47. Chapter 3 - Object-Orientation
public void setName(String n){
name = n;
}
public String getName(){
return name;
}
public float getBalance(){
return balance;
}
public void setAccountNo(int ac){
acctNo = ac;
}
public int getAccountNo(){
return acctNo;
}
public void setOverdraft(boolean x)
{
overdraft = x;
}
public boolean getOverdraft(){
return overdraft;
}
}
ABSTRACTION & ENCAPSULATION
48. Chapter 3 - Object-Orientation
public class TestAccount3{
public static void main(String args[]){
Account3 myAccount = new Account3(“Bin", 007);
// System.out.println("This account belongs to: " + myAccount.name);
System.out.println("Account of " + myAccount.getName());
// System.out.println("Current Balance is = "+ myAccount.balance);
System.out.println("Current Balance is ="+myAccount.getBalance());
System.out.println("After withdrawing P2000......");
myAccount.withdrawal(2000);
System.out.println("After withdrawing P100 ......");
myAccount.withdrawal(100);
// System.out.println("The new balance is = " + myAccount.balance);
System.out.println("The new balance is = " + myAccount.getBalance());
}
}
ABSTRACTION & ENCAPSULATION
49. Chapter 3 - Object-OrientationABSTRACTION & ENCAPSULATION
Open Account3.java and TestAccount3.java
Since TestAccount3.java has an object of type Account,
compile TestAccount3.java to compile the two files
EXERCISE: Exploring Classes and Objects
60. Chapter 3 - Object-Orientation
public class Account2 {
public String name;
public int acctNo;
public float balance;
public boolean overdraft;
public Account2(String n, int no) {
name = n;
acctNo = no;
balance = 4000F;
overdraft = false;
}
public void deposit(float amt)
public void withdrawal(float amt)
public void transfer(Account from, float amt)
}
61. Chapter 3 - Object-Orientation
public class TestAccount2 {
public static void main(String args[]){
Account2 myAccount = new Account2("Bin", 007);
// myAccount.name = "Bin"; myAccount.acctNo = 007;
// myAccount.balance = 4000; myAccount.overdraft = false;
System.out.println("This account belongs to: "+ myAccount.name);
System.out.println("Current Balance is = "+ myAccount.balance);
System.out.println("After withdrawing P2000......");
myAccount.withdrawal(2000);
System.out.println("After withdrawing P100 ......");
myAccount.withdrawal(100);
System.out.println("The new balance is = " + myAccount.balance);
}
}
62. Chapter 3 - Object-Orientation
public class Account3 {
public String name;
public int acctNo;
public float balance;
public boolean overdraft;
public Account3(String n, int no, float bal, boolean od) {
name = n;
acctNo = no;
balance = bal;
overdraft = od;
}
public void deposit(float amt)
public void withdrawal(float amt)
public void transfer(Account from, float amt)
}
63. Chapter 3 - Object-Orientation
public class TestAccount3 {
public static void main(String args[]){
Account3 myAccount = new Account3("Bin", 007, 5000,true);
// myAccount.name = "Bin"; myAccount.acctNo = 007;
// myAccount.balance = 5000; myAccount.overdraft = true;
System.out.println("This account belongs to: "+ myAccount.name);
System.out.println("Current Balance is = "+ myAccount.balance);
System.out.println("After withdrawing P2000......");
myAccount.withdrawal(2000);
System.out.println("After withdrawing P100 ......");
myAccount.withdrawal(100);
System.out.println("The new balance is = " + myAccount.balance);
}
}