oop

Cards (39)

  • Object-Oriented Programming (OOP) is a methodology to design a program using classes and objects
  • OOP aims to implement real-world entities like inheritance, hiding, and polymorphism in programming
  • The primary purpose of a class is to store data and information
  • An object is any entity that has state and behavior
  • An object can be defined as an instance of a class
  • Inheritance is when one object acquires all the properties and behaviors of a parent object
  • Polymorphism is when one task is performed in different ways
  • In Java, method overloading and method overriding are used to achieve polymorphism
  • Abstraction is hiding internal details and showing functionality
  • In Java, abstract class and interface are used to achieve abstraction
  • Encapsulation is binding code and data together into a single unit
  • A Java class is an example of encapsulation
  • Advantages of OOP over Procedure-oriented programming language
  • OOP makes development and maintenance easier
  • OOP provides data hiding
  • OOP provides the ability to simulate real-world events more effectively
  • Java is a popular programming language and platform used in various applications
  • Java is used in desktop, web applications, scientific supercomputers, gaming consoles, cell phones, and the Internet
  • Java was initially named "Oak" in 1991 for consumer electronic appliances
  • Java was developed by James Gosling at Suns Micro System
  • Oak was redesigned in 1995 and renamed Java for internet applications
  • Characteristics of Java
  • Java is a simple, easy to write, and readable language
  • Java has a concise set of features making it easy to learn
  • Java is an object-oriented programming language with features drawn from C++
  • Java is platform-independent, robust, supports multi-threading, and offers high performance
  • Java provides strong security, portability, and a secure way to access web applications
  • Java Technology includes programming, development, application, and deployment environments
  • Java can create various applications using conventional programming languages
  • Java technology applications run on any machine with Java Runtime Environment (JRE)
  • Phases of Java Program
  • Java source file must have the same name as a public class it declares
  • Java source file can contain only one public class declaration
  • Java source file extension must be .java and filename is case-sensitive
  • Java programs need to be written, compiled into bytecode, and interpreted by the Java Virtual Machine (JVM)
  • Summary of the Phases of Java Program
  • Java programs need to be compiled to bytecode and then converted to machine code when run
  • In OOP, objects model real-world objects and consist of important concepts like Encapsulation, Polymorphism, Inheritance, and Abstraction
  • In Java, the state is the set of values of an object's variables and behavior is implemented as methods