6.08k likes | 6.1k Views
Features<br>1.1 Shared with non-OOP predecessor languages<br>1.2 Objects and classes<br>1.3 Class-based vs prototype-based<br>1.4 Dynamic dispatch/message passing<br>1.5 Encapsulation<br>1.6 Composition, inheritance, and delegation<br>1.7 Polymorphism<br>1.8 Open recursion<br><br><br>https://www.timehubzone.com/worldclock/europe
E N D
Object Oriented Programming Tutorial Contents Features 1.1 Shared with nonOOP predecessor languages 1.2 Objects and classes 1.3 Class-based vs prototype-based
Object Oriented Programming Tutorial 1.4 Dynamic dispatch/message passing 1.5 Encapsulation 1.6 Composition, inheritance, and delegation 1.7 Polymorphism 1.8 Open recursion
Object Oriented Programming Tutorial Object Oriented Programming Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a
Object Oriented Programming Tutorial methodology to design a program using classes and objects. Its main concepts: Object Class Inheritance Polymorphism
Object Oriented Programming Tutorial Abstraction Encapsulation Primitive Primitive data type Int, float , double Boolean, string..... Explicitly
Object Oriented Programming Tutorial Anything create by customize call is explicitly. Change the type of variable customlly is call explicitly. Change the type of variable on runtime is call explicitly.
Object Oriented Programming Tutorial Implicitly Anything create by default call is implicitly. Change the type of variable by customlly Change the type of variable on compile time is call explicitly.
Object Oriented Programming Tutorial Instance Any thing belongs to object is instance An instance is a specific representation of an object, an instance is a single object that has
Object Oriented Programming Tutorial been created in memory. Instances have attribute and behaviors of class Instance: Student s1=new student ("Martin");
Object Oriented Programming Tutorial Student s2=new student ("Kumar"); si and s2 are instances of object student the two are unique. it can be called as reference also.
Object Oriented Programming Tutorial Basically the si and s2 are variables that are assigned an object All the objects are instances. All the instances may not be objects. Instances may be "structure
Object Oriented Programming Tutorial instances" or "objects". worldclock Instance The instance of operator is used to test whether the
Object Oriented Programming Tutorial object is an instance of the specified type (class or subclass or interface). The instance of in java is also known as type comparison
Object Oriented Programming Tutorial operator because it compares the instance with type. It returns either true or false. If we apply the instance of operator with any variable that
Object Oriented Programming Tutorial has null value, it returns false Instantiating any thing point to object is call instantiating B =new class ()// its call instantiating
Object Oriented Programming Tutorial an instance (chair 3) is a single unique, specific representation of an object (a chair). Member Members are just objects or primitive
Object Oriented Programming Tutorial types belonging to a class The following table provides an overview of the kinds of members a class can contain. (Rows for...) Constants
Object Oriented Programming Tutorial Fields Methods Properties Indexers Events Operators Constructors Destructors Types
Object Oriented Programming Tutorial Property A property describes some aspect of the object Properties are a way to expose fields, where fields are the actual variables
Object Oriented Programming Tutorial Class member variables are called "properties Variables in the class is call property Instance variable A variable that is created inside the class but outside the method is
Object Oriented Programming Tutorial known as instance variable. Instance variable doesn't get memory at compile time. It gets memory at runtime when object (instance) is created. That is
Object Oriented Programming Tutorial why, it is known as instance variable. current local time Instance member variable
Object Oriented Programming Tutorial Create a variable without static keyword is call instance member variable Instance member method Create a method without static keyword
Object Oriented Programming Tutorial is call instance member method Static member variable or class member variable Create a variable with static keyword is call class member or static member variable
Object Oriented Programming Tutorial Static member method or class member method Create a method with static keyword is call class member or static member method Object An entity that has state and
Object Oriented Programming Tutorial behavior is known as an object e.g. chair, bike, marker, pen, table, car etc. It can be physical or logical (tangible and intangible). The example of
Object Oriented Programming Tutorial intangible object is banking system. An object has three characteristics: State: represents data (value) of an object.
Object Oriented Programming Tutorial Behavior: represen ts the behavior (functionality) of an object such as deposit, withdraw etc. Identity: Object identity is typically implemented via a
Object Oriented Programming Tutorial unique ID. The value of the ID is not visible to the external user. But, it is used internally by the JVM to identify each object uniquely. For Example: Pen
Object Oriented Programming Tutorial is an object. Its name is Reynolds, color is white etc. known as its state. It is used to write, so writing is its behavior. Object is an instance of a
Object Oriented Programming Tutorial class. Class is a template or blueprint from which objects are created. So object is the instance (result) of a class.
Object Oriented Programming Tutorial Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.
Object Oriented Programming Tutorial Object is a thing, but instance is a part of a bundle thing. For example, if Car is a class, then it should contain some of the objects like wheel, steering, door and seat. Now lets come to the point:
Object Oriented Programming Tutorial an object (wheel) is an instance of the Car Memory allocated for the member of class at run time is called object or object is the instance of Class.
Object Oriented Programming Tutorial Object - An instance of a class that has its own state and access to all of the behaviour defined by its class. Object s are instances of class Object is complex data structure
Object Oriented Programming Tutorial Attribute and behaviors Student s1=new student ("Martin"); Student s2=new student("Kumar"); The s1, s2 are having object of class Student
Object Oriented Programming Tutorial time zone Anonymous object Anonymous simply means nameless. An object that has no reference is known as anonymous object.
Object Oriented Programming Tutorial If you have to use an object only once, anonymous object is a good approach. Class A class is a group of objects that has
Object Oriented Programming Tutorial common properties. It is a template or blueprint from which objects are created. A class in java can contain: data member
Object Oriented Programming Tutorial method constructor block class and interface Difference between object and class There are many differences between object
Object Oriented Programming Tutorial and class. A list of differences between object and class are given below: No. Object C 1) Object is C an instance of a a t
Object Oriented Programming Tutorial class. w C 2) Object is a real C world a entity such as s pen, laptop, < mobile, bed, keyboard, mouse, chair etc.
Object Oriented Programming Tutorial 3) Object is C a physical entity. c 4) Object is created C through new c keyword mainly u e.g. k Student s1 = new c Student();
Object Oriented Programming Tutorial 5) Object is C created many c times as per requirement. 6) Object allocates C memory when c it is created. r i
Object Oriented Programming Tutorial 7) There are many T ways to create o object in java t such as new c keyword, new i Instance() k method, clone() method, factory method and
Object Oriented Programming Tutorial deserialization. Aggregation If a class has an entity reference, it is known as Aggregation. Aggregation represents HAS-A relationship.
Object Oriented Programming Tutorial Consider a situation, Employee object contains many information's such as id, name, email ID etc. It contains one more object named address,
Object Oriented Programming Tutorial which contains its own information's such as city, state, country, zip code etc Why use Aggregation? For Code Reusability.
Object Oriented Programming Tutorial When use Aggregation? Code reuse is also best achieved by aggregation when there is no is-a relationship. Inheritance should be used only if the
Object Oriented Programming Tutorial relationship is-a is maintained throughout the lifetime of the objects involved; otherwise, aggregation is the best choice. New keyword