oop

Subdecks (2)

Cards (81)

  • Object-Oriented Programming (OOP)
    Programming paradigm that focuses on modeling data
  • Programming language families
    • Machine languages
    • Assembly languages
    • High-Level languages
  • Machine languages
    • Comprised of 1s and 0s
    • The "native" language of a computer
    • Difficult to program - one misplaced 1 or 0 will cause the program to fail
  • Machine language code
    • 1110100010101
    • 111010101110
    • 10111010110100
    • 10100011110111
  • Assembly languages
    • A step towards easier programming
    • Comprised of a set of elemental commands which are tiled to a specific processor
    • Assembly language code needs to be translated to machine language before the computer processes it
  • Assembly language code
    • ADD 1001010,1011010
    • MOV AX,BX
  • High-Level languages
    • Represent a giant leap towards easier programming
    • The syntax of HL languages is similar to English
  • High-Level language groups
    • Function-Oriented languages
    • Object-Oriented languages (OOP)
  • Function-Oriented (Procedural) languages
    • Early high-level languages
    • Characterized by sequential sets of linear commands
    • The focus is on structure
  • Object-Oriented languages
    • Most are high-level languages
    • The focus is on modeling data
    • Programmers code using "blueprints" of data models called classes
  • Object-Oriented languages
    • C++
    • Visual Basic.NET
    • Java
  • Java
    Programming language originally developed by Sun Microsystems, initiated by James Gosling and released in 1995
  • Java
    • Object Oriented
    • Platform Independent
    • Simple
    • Secure
    • Architecture-neutral
    • Portable
    • Robust
    • Multithreaded
    • Interpreted
    • High Performance
    • Distributed
    • Dynamic
  • James Gosling initiated Java language project

    June 1991
  • Sun released the first public implementation as Java 1.0
    1995
  • Sun released much of Java as free and open source software
    13 November, 2006
  • Sun finished the process, making all of Java's core code free and opensource
    8 May, 2007
  • Five Phases of JAVA Programs
    1. Edit
    2. Compile javac (java compiler)
    3. Load
    4. Verify
    5. Execute
  • Tools You Will Need for Java Programming
  • Popular Java Editors
    • Notepad
    • Textpad
    • Wordpad
    • Netbeans
    • Eclipse
    • JCreator
  • Object
    Unique programming entity that has methods, has attributes and can react to events
  • Method
    Things which an object can do; the "verbs" of objects
  • Attribute
    Things which describe an object; the "adjectives" of objects
  • Events
    Forces external to an object to which that object can react
  • Class
    Provides a way to create new objects based on a "meta-definition" of an object
  • Constructors
    Special methods used to create new instances of a class
  • Class Names

    For all class names the first letter should be in Upper Case. If several words are used to form a name of the class, each inner word's first letter should be in Upper Case.
  • Method Names
    All method names should start with a Lower Case letter. If several words are used to form the name of the method, then each inner word's first letter should be in Upper Case.
  • Program File Name
    Name of the program file should exactly match the class name. When saving the file, you should save it using the class name and append '.java' to the end of the name.
  • public static void main(String args[])
    Java program processing starts from the main() method which is a mandatory part of every Java program.
  • Java Identifiers
    All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_). After the first character, identifiers can have any combination of characters. A key word cannot be used as an identifier. Identifiers are case sensitive.
  • Examples of legal identifiers
    • age
    • $salary
    • _value
    • __1_value
  • Examples of illegal identifiers
    • 123abc
    • -salary
  • Robust: Java makes an effort to eliminate error prone
    situations by emphasizing mainly on compile time error
    checking and runtime checking.
  • Multithreaded: With Java's multithreaded feature it is
    possible to write programs that can perform many tasks
    simultaneously. This design feature allows the
    developers to construct interactive applications that can
    run smoothly.
  • Interpreted: Java byte code is translated on the fly to
    native machine instructions and is not stored anywhere.
    The development process is more rapid and analytical
    since the linking is an incremental and light-weight
    process.
  • High Performance: With the use of Just-In-Time
    compilers, Java enables high performance.
  • Distributed: Java is designed for the distributed
    environment of the internet.
  • Dynamic: Java is considered to be more dynamic than C
    or C++ since it is designed to adapt to an evolving
    environment. Java programs can carry extensive amount
    of run-time information that can be used to verify and
    resolve accesses to objects on run-time.
  • Edit
    The programmer writes the program (preferably on a
    notepad) and saves it as a ‘.java’ file, which is then
    further used for compilation, by the compiler.