๐ผ OBJECT: An Object is an entity that has a state and behavior, e.g., car, pen, table, etc. It can be physical or logical (tangible and intangible). An example of an intangible object is the banking system.
Characteristics of Object: State (Represents the data of an object). Behavior (Represents the behavior of an object such as deposit, withdraw, etc). Identity (It is used internally by the JVM to identify each object uniquely)
๐ผ CLASS: A class is a group of objects that have common properties. It is a template or blueprint from which objects are created. It is a logical entity. It canโt be physical. Class in java can be fields, methods, constructors, blocks, nested class and interface.
๐ผ METHOD: A method is a way to perform some tasks. In Java, a method is a collection of instructions that perform a specific task. It provides the reusability of code.
Types of Method: Predefined, User-defined
Static Method: A method that belongs to a class rather than an instance of a class is known as a static method. We can create a static method by using the keyword static before the method name.
Instance Method: It is a non-static method defined in the class. Before calling or invoking the instance method, an object of its class must be created.
Abstract Method: A method that does not have a method body is known as an abstract method. The class must be abstract if it has an abstract method
๐ผ CONSTRUCTORS: In JAVA, a constructor is a block of codes similar to the method. At the time of calling the constructor, memory for the object is allocated in the memory. There are some rules defined for the constructor:
๐ผ INHERITANCE:
๐ผ Polymorphism
๐ผ Abstraction
๐ผ Encapsulation
๐ผ STATIC KEY WORD: The static keyword in Java is used mainly for memory management. We can apply static keyword with variables, methods, blocks, and nested classes. The static keyword belongs to the class rather than an instance of the class. The static can be variable or method.
๐ผ Welcome message to user
๐ผ Deposit
๐ผ Withdraw
๐ผ Get previous transaction
๐ผ Show menu
๐ผ Execute our code