78
© People Strategists - Duplication is strictly prohibited - www.peoplestrategists.com 1

Java Day-2

Embed Size (px)

Citation preview

© People Strategists - Duplication is strictly prohibited -www.peoplestrategists.com

1

Object OrientedProgramming

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 2

DAY 2Object Oriented Programming

Objects And ClassesEncapsulationPolymorphism

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 3

Introduction to Object-Oriented Programming

• The object-oriented is a programming paradigm where the programlogic and data are weaved.

• OOPs is a way of conceptualizing a program's data into discrete"things" referred to as objects, each having its own properties andmethods.

• For example, your friend is a bank manager and he wants you to helpimproving systems. The first object you might design is thegeneral-purpose Account. The Account object has properties andmethods. For each client your friend's bank have, you would have tocreate an Account object.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 4

Introduction to Object-Oriented Programming(Contd.)

Object

Characteristics of OOP

Class

Encapsulation

Inheritance

Polymorphism

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 5

Introduction to Object-Oriented Programming(Contd.)• Benefits of OOP:

• Re-usability: You can write a program using a previous developed code.• Code Sharing: You are able to standardize the way your are programming with

your colleagues.• Rapid Modeling: You can prototype the classes and their interaction through

a diagram.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 6

Objects

• An entity that has state and behavior is known as an object, such as chair,bike, marker, pen, table, and car.

• It can be physical or logical (tangible and intangible).• The example of intangible object is banking system.• An object has three characteristics:

• State: Represents data (value) of an object.• Behavior: Represents the behavior (functionality or action) of an object, such as

deposit and withdraw.• Identity: Object identity is typically implemented via a unique ID. The value of the ID

is not visible to the external user.However, it is used internally by the JVM to identify each object uniquely.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 7

Objects (Contd.)

• At any point in time, an object can be described from the data itcontains.

• An object is an instance of a class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 8

Objects (Contd.)

• Example:

Car Objet

States:BrandModelPriceColor

Behaviors:Starting carStopping car

Changing gearApplying brake

Get km/liter© People Strategists - Distribution is strictly prohibited -

www.peoplestrategists.com 9

Classes

• A class is a collection of objects (or values) and a corresponding set ofmethods.

• Objects contain data and methods, but to use objects in a program, a classneeds to be created.

• A class lets us define what data is going to be stored in the object, how itcan be accessed and modified, and what actions can be performed on it.

• Thus, a class is a template for an object.• Example:

A set of cars with operations, such as starting, stopping, changing gear,applying brake, and get km/liter.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 10

Encapsulation and Access Control

• Encapsulation is the mechanism that binds together code and thedata it manipulates, and keeps both safe from outside interferenceand misuse.

• A protective wrapper that prevents the code and data from beingarbitrarily accessed by other code defined outside the wrapper.

• Access to the code and data inside the wrapper is tightly controlledthrough a well-defined interface.

• The basis of encapsulation is the class.• When you create a class, you will specify the code and data that

constitute that class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 11

Encapsulation and Access Control(Contd.)

• The data defined by the class are referred to as member variables orinstance variables.

• The code that operates on that data is referred to as membermethods.

• The complexity of the implementation inside the class can be hided.• Each method or variable in a class may be marked private or public.• The private methods and data can only be accessed by code that is a

member of the class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 12

Encapsulation and Access Control(Contd.)

• The following figure describes conceptual representation ofencapsulation concept:

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 13

Inheritance

• Inheritance is the process by which one object acquires theproperties of another object.

• It supports the concept of hierarchical classification.• For example, a Golden Retriever is part of the classification dog,

which in turn is part of the mammal class, which is under the largerclass animal.

• Without the use of hierarchies, each object would need to define allof its characteristics explicitly.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 14

Inheritance (Contd.)

• By use of inheritance, an object need only define those qualities thatmake it unique within its class. It can inherit its general attributesfrom its parent.

• It is the inheritance mechanism that makes it possible for one objectto be a specific instance of a more general case.

• Inheritance interacts with encapsulation as well.• If a given class encapsulates some attributes, then any subclass will

have the same attributes plus any that it adds as part of itsspecialization.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 15

Inheritance (Contd.)

• A new subclass inherits all of the attributes of all of its ancestors.• The following figure describes conceptual representation of

inheritance concept:

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 16

Polymorphism

• Derived from two Latin words - Poly, which means many, andmorph, which means forms.

• Polymorphism is the capability of an action or method to do differentthings based on the object that it is acting upon.

• In object-oriented programming, polymorphism refers to aprogramming language's ability to process objects differentlydepending on their data type or class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 17

Polymorphism, Encapsulation, andInheritance Work Together (Contd.)• The following figure describes conceptual representation of

polymorphism, encapsulation, and inheritance working together:

Shape

Draw()

Triangle

Draw()

Rectangle

Draw()

Circle

Draw()

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 18

Objects And Classes

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 19

Defining a Class

• The syntax to define a class:class <class_name>

{

……}

• An example to define a class:class SimpleCalculator {

}

• In the preceding code snippet is used to define SimpleCalulator class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 20

Creating an Object

• The syntax to create an object:<classname> <object ref variable> = new <classname>();

• An example to create an object:SimpleCalculator obj=new SimpleCalculator();

• In the preceding code snippet, a object reference variable named objof type SimpleCalculator is created. The new operator creates a newSimpleCalculator object on the heap memory and assigns this objectto the reference variable, obj.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 21

Creating an Object (Contd.)

• You can also assign null to an object reference variable as shown inthe following code snippet:

SimpleCalculator obj=null;

• The preceding code snippet creates an object reference variable but itdoes not refers any object. Here, only a space for the object referencevariable is created but an actual SimpleCalculator object is notcreated.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 22

Instance Variable

• Instance variable is a variable defined inside the class, but outside anymethod.

• Each instantiated object has a separate copy of instance variable.• If the instance variables are not initialized, they will have the default value.• An example to create instance variable:

class SimpleCalculator {

int operand1, operand2,result;

}

• In the preceding code snippet, operand1,operand2, and result are theinstance variables of SimpleCalculator class.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 23

Method

• A method is a block of statements that has a name and can beexecuted by calling.

• A method is defined to preform certain task.• The syntax to define a method:

<returntype> <methodname>(parameterlist){

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 24

Method (Contd.)

• The different types of methods are:• Method without return type and without parameter• Method without return type and with parameter• Method with return type and without parameter• Method with return type and with parameter.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 25

Method (Contd.)

• An example to define a method without return type and withoutparameter:void sum(){

int a=10;int b=20;int result=a+b;System.out.println(“The sum:”+result);

}

• If a method does not return any value, then the return type should beset to void.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 26

Method (Contd.)

• An example to define a method without return type and withparameter:void sum(int a, int b){

int result=a+b;System.out.println(“The sum :”+result);

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 27

Method (Contd.)

• An example to define a method with return type and withoutparameter:int sum(){

int a=10;int b=20;int result=a+b;return result;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 28

Method (Contd.)

• An example to define a method with return type and with parameter:int sum(int a, int b){

int result=a+b;return result;}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 29

Method (Contd.)

• An example to define a instance method and call the method using object:public class SimpleCalculator {

int sum(int a, int b){int result=a+b;return result;

}public static void main(String args[]){

SimpleCalculator obj=new SimpleCalculator();int rVal=obj.sum(10,20);System.out.println("The sum:"+rVal);}

}

• In the preceding code, the dot operator is used to invoke theinstance method.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 30

Method (Contd.)

• You can also pass reference variables as arguments to a method asshown in the following code:

class Points{int x=10,y=-5;

}public class MethodPORDemo {

void changePoints(Points p){System.out.println("x="+p.x);System.out.println("y="+p.y);

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 31

Method (Contd.)

p.x=-5;p.y=10;System.out.println("x="+p.x);System.out.println("y="+p.y);

}public static void main(String args[]){

Points pObj=new Points();MethodPORDemo mObj=new MethodPORDemo();mObj.changePoints(pObj);

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 32

Method (Contd.)

• The preceding code output will be:x=10y=-5x=-5y=10

• A method can also return a refernce type as shown in the followingcode:class Circle {

int radius=10;}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 33

Method (Contd.)

public class MethodRODemo {Circle getCircleObject(Circle cObj) {

cObj.radius=20;return cObj;

}public static void main(String args[]){

MethodRODemo mObj=new MethodRODemo();Circle c1=new Circle();System.out.println("Radius="+c1.radius);Circle c2=mObj.getCircleObject(c1);System.out.println("Radius="+c2.radius);

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 34

Method (Contd.)

• The preceding code output will be:Radius=10Radius=20

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 35

Constructor

• Constructor is a special type of method that has the same name ofthe class and does not has any return type.

• The constructor is automatically called when an object is created.• The constructor is used to initialize the instance variable of a class.• An example to define a constructor without parameter:

class SimpleCalculator {int operand1,operand2;

SimpleCalculator(){operand1=5;operand2=6;

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 36

Constructor (Contd.)

• An example to define a parameterized constructor:class SimpleCalculator {

int operand1,operand2;SimpleCalculator(int oprd1,int oprd2){

operand1=oprd1;operand2=oprd2;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 37

Constructor (Contd.)

public static void main(String args[]){SimpleCalculator obj1=new

SimpleCalculator(10,20);SimpleCalculator obj2=new

SimpleCalculator(1,2);System.out.println(obj1.operand1);System.out.println(obj2.operand1);

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 38

Constructor (Contd.)

• The preceding code output will be:101

• If a constructor is not defined explicitly, the compiler addsan default constructor.

• A default constructor is a constructor without arguments.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 39

Constructor (Contd.)

• Consider the following code:

public class ConstructorDemo {int x;public ConstructorDemo(int a) {

x=a;}

public static void main(String args[]){ConstructorDemo cdObj=new ConstructorDemo();

}}

• The preceding code will generate a compilation error, as the classdoes not defines a no argument constructor.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 40

Encapsulation

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 41

Package

• A package is a namespace that organizes a set of related types, such asclasses and interfaces.

• The syntax to create a package is:package <package name>;

• An example to create package:package test;

class PackageDemo

{

}

• In the preceding code snippet, the PackageDemo class belongs to testpackage.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 42

Package

• A class can access the classes in another package by importing therequired package.

• The syntax to import a package is:import <package name>.*;

• An example to import a package:import test.*;class Demo{}

• In the preceding code snippet, the Demo class can access the classesinside test package.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 43

Access Modifiers

• Access level modifiers determine whether other classes can use aparticular field or invoke a particular method.

• Java has four access control levels, public, protected, default, andprivate.

• But there are only three access modifiers, public, protected, andprivate.

• When any of the three access modifier is not specified then thedefault access control level is specified.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 44

Access Modifiers (Contd.)

• The following table shows the access to members permitted by eachmodifier:

Modifier Class Package Subclasspublic Y Y Yprotected Y Y Yno modifier Y Y Nprivate Y N N

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 45

Access Modifiers (Contd.)

• All the four access modifiers can be used with the instance variables.• The top level class can use only public and default modifier.• The constructor can use all the four access modifiers.• An example to work with access modifier:

package pack1;public class Test {public int testA;private int testB;protected int testC;int testD;

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 46

Access Modifiers (Contd.)

Test(){testA=1;testB=2;testC=3;testD=4;

}public Test(int a,int b, int c, int d){

testA=a;testB=b;testC=c;testD=d;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 47

Access Modifiers (Contd.)

public void testPrint(){System.out.println("public method testPrint");

}private void testDisplay(){

System.out.println("private method testDisplay");}protected void testPut(){

System.out.println("protected method testPut");}

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 48

Access Modifiers (Contd.)

package pack1;class Sample {public int sampleA;private int sampleB;protected int sampleC;public Sample(int a,int b, int c){

sampleA=a;sampleB=b;sampleC=c;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 49

Access Modifiers (Contd.)

public void samplePrint(){

System.out.println("public method samplePrint");

}

private void sampleDisplay(){

System.out.println("private method sampleDisplay");

}

protected void samplePut(){

System.out.println("protected method samplePut");

}

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 50

Access Modifiers (Contd.)

package pack2;

import pack1.*;

public class Demo {

public static void main(String args[]){

Test testObj=new Test(10,20,30,40);

System.out.println(testObj.testA);

testObj.testPrint();

}

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 51

Access Modifiers (Contd.)

• The preceding code output will be:10

public method testPrint

• In the preceding code, inside the Demo class Sample class cannot beaccessed because the Sample class has default access control.

• Similarly, the variable, testB, testC, and testD are not accessible asthey have private, protected, and default access control.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 52

Encapsulation Implementation

• To create a Java program that supports maintainability, flexibility, andextensibility, then it must include encapsulation.

• Encapsulation is implemented by:• Protecting the instance variable.• Make public accessor methods to access the instance variable.

• An example to implement encapsulation:class Rectangle {

private int length;private int breadth;

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 53

Encapsulation Implementation (Contd.)

public int getLength() {return length;

}public void setLength(int l) {

length = l;}public int getBreadth() {

return breadth;}public void setBreadth(int b) {

breadth = b;}

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 54

Encapsulation Implementation (Contd.)

public class EncapsulationDemo {public static void main(String args[]){

Rectangle r=new Rectangle();r.setLength(10);r.setBreadth(20);

}}

• The preceding code forces to access the instance variable to beaccessed using methods. This methodology allows to modify theimplementation later without affecting the other classes which usesthe instance variables.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 55

Polymorphism

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 56

Method Overloading

• If two or more method in a class have same name but differentparameters, it is known as method overloading.

• Method overloading is one of the ways through which Java supportspolymorphism.

• An example to implement method overloading:public class SimpleCalculator {

void add(int a, int b){int result=a+b;System.out.println("The sum:"+result);

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 57

Method Overloading (Contd.)

void add(int a, int b,int c){int result=a+b+c;System.out.println("The sum:"+result);

}}

void add(double a, double b){double result=a+b;System.out.println("The sum:"+result);

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 58

Method Overloading (Contd.)

public static void main(String args[]){SimpleCalculator obj=new SimpleCalculator();obj.add(1,2);obj.add(1,2,3);obj.add(23.5,34.7);

}}

• The preceding code output will be:The sum:3The sum:6The sum:58.2

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 59

Method Overloading (Contd.)

• The following code snippet is a non-example of method overloading:public void print(){

}private void print(){}

• The following code snippet is an example of method overloading:public void print(){

}private void print(int x){

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 60

Method Overloading (Contd.)

• The following code snippet is a non-example of method overloading:public void print(){

}private int print(){

}

• The following code snippet is an example of method overloading:public void print(){

}private int print(int x){

return 1;}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 61

Constructor Overloading

• When more than one constructor is defined in a class, it is known asconstructor overloading.

• An example to implement constructor overloading:public class SimpleCalculator {

int operand1,operand2,result;SimpleCalculator(){

operand1=1;operand2=2;

}SimpleCalculator(int oprd1, int oprd2){

operand1=oprd1;operand2=oprd2;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 62

Constructor Overloading (Contd.)

void sum(){result=operand1+operand2;System.out.println("The sum: "+result);

}public static void main(String args[]){

SimpleCalculator obj1=new SimpleCalculator();obj1.sum();SimpleCalculator obj2=new SimpleCalculator(12,45);obj2.sum();

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 63

Constructor Overloading (Contd.)

• The preceding code output will be:The sum: 3The sum: 57

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 64

Variable Argument

• Variable argument allows the method to accept zero or multiplearguments.

• The syntax to define a variable argument method:<return type> <method name>(<data type>…<variablename>){}

• An example to define a variable argument method:void display(int…a){

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 65

Variable Argument (Contd.)

• An example to implement variable argument:public class Demo{

void display(int...a){int count=0;for(int x:a){

count++;}System.out.println("The number arguments:"+count);

}public static void main(String args[]){

Demo obj=new Demo();obj.display();obj.display(1);obj.display(1,2);obj.display(1,2,3);

}}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 66

Variable Argument (Contd.)

• The preceding code output will be:The number arguments:0The number arguments:1The number arguments:2The number arguments:3

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 67

Variable Argument (Contd.)

• Rules to work with variable argument:• A method can have only one variable argument parameter.• The variable argument must be the last parameter of the method.

• The following code snippet is a non-example of variable argumentimplementation:void display(int...a, int...b){ }void display(int...a, int b){ }

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 68

Variable Argument and Overloading

• Consider a scenario, where you need to pass many instance of sameobject to a method. In such situation, the programmer has twochoices:

• Create an overloaded method• Create a method that accepts array or other collections

• However, at compile time if you do not know how many instance willbe used creating an overloaded method becomes difficult.

• Working with arrays and other collections makes the code lengthyand complex.

• Therefore, variable arguments were introduced to simplify the task ofthe programmer.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 69

Use of this Keyword

• The this keyword is used to refer the current object in the code.• Consider the following code:

public class SimpleCalculator {SimpleCalculator(int operand1, int operand2){

}

• In the preceding code snippet, the instance variable and theparameter variable of the constructor have the same name.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 70

Use of this Keyword (Contd.)

• In such situation, to use the instance variable inside the constructorthe this keyword is used as shown in the following code snippet:SimpleCalculator(int operand1, int operand2){

this.operand1=operand1;this.operand2=operand2;

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 71

Use of this Keyword (Contd.)

• An example to work with this keyword:public class SimpleCalculator {

int operand1,operand2,result;SimpleCalculator(){

operand1=10;operand2=20;

}SimpleCalculator(int operand1, int operand2){

this.operand1=operand1;this.operand2=operand2;

}int sum(){result=operand1+operand2;return result;}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 72

Use of this Keyword (Contd.)

public static void main(String args[]){SimpleCalculator obj=new SimpleCalculator(102,52);int rVal=obj.sum();System.out.println("The sum:"+rVal);}

}

• The preceding code output will be:The sum:154

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 73

Use of this Keyword (Contd.)

• An example to work with constructor chaining using this keyword:class Flower{

String flowerName;Flower(){

this("Rose");}Flower(String flowerName){

this.flowerName=flowerName;}

}

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 74

Use of this Keyword (Contd.)

public class ConstructorDemo {public static void main(String args[]){

Flower fObj=new Flower();System.out.println(fObj.flowerName);

}}

• The preceding code output will be:Rose

• The constructor chaining avoids code duplication.• Note: The this() statement should be the first line in the constructor

definition.© People Strategists - Distribution is strictly prohibited -

www.peoplestrategists.com 75

Summary

• You have learnt that:• The object-oriented is a programming paradigm where the program logic and

data are weaved.• The characteristic of OOPs are class, object, polymorphism, encapsulation,

and inheritance.• An entity that has state and behavior is known as an object.• A class is a collection of objects and a corresponding set of methods.• Encapsulation is the mechanism that binds together code and the data it

manipulates, and keeps both safe from outside interference and misuse.• Inheritance is the process by which one object acquires the properties of

another object.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 76

Summary (Contd.)

• Polymorphism is the capability of an action or method to do different thingsbased on the object that it is acting upon.

• Define class, constructor and method.• Create object and instance variable.• A package is a namespace that organizes a set of related types, such as classes

and interfaces.• Access level modifiers determine whether other classes can use a particular

field or invoke a particular method.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 77

Summary

• If two or more method in a class have same name but different parameters, itis known as method overloading.

• When more than one constructor is defined in a class, it is known asconstructor overloading.

• Variable argument allows the method to accept zero or multiple arguments.

© People Strategists - Distribution is strictly prohibited -www.peoplestrategists.com 78