• Home
  • Courses

    About Courses

    • Core Java
    • JDBC
    JDBC

    JDBC

    Free
    Read More
  • Features
    • Portfolio
    • About Us
    • FAQs
  • Gallery
  • Blog
  • Contact
      • Cart

        0
    Hacked by Katib | Turkish Hacker | SpyHackerz.OrgHacked by Katib | Turkish Hacker | SpyHackerz.Org
    • Home
    • Courses

      About Courses

      • Core Java
      • JDBC
      JDBC

      JDBC

      Free
      Read More
    • Features
      • Portfolio
      • About Us
      • FAQs
    • Gallery
    • Blog
    • Contact
        • Cart

          0

      JAVA TECHNOLOGIES

      • Home
      • All courses
      • JAVA TECHNOLOGIES
      • Core Java
      LP CoursesJAVA TECHNOLOGIESCore Java
        • Lecture1.1
          What is Java? 30 min
        • Lecture1.2
          JDK Installation Steps 30 min
        • Lecture1.3
          First Program in Java 30 min
        • Lecture1.4
          C++ vs Java 30 min
        • Lecture1.5
          Java Comments 30 min
        • Lecture1.6
          Java Operators 30 min
        • Lecture1.7
          Java Loop Control 30 min
        • Lecture1.8
          Decision making 30 min
        • Lecture1.9
          Object Oriented Programming 30 min
        • Lecture1.10
          Objects and Classes 30 min
        • Lecture1.11
          Java Inheritance 30 min
        • Lecture1.12
          Static,non-static and final 30 min
        • Lecture1.13
          Abstract Class vs Interface 30 min
        • Lecture1.14
          Overloading vs Overriding 30 min

        Objects and Classes

        Objects

        In object-oriented programming we create software objects that model real world objects. Software objects are modeled after real-world objects in that they too have state and behavior. A software object maintains its state in one or more variables. A variable is an item of data named by an identifier. A software object implements its behavior with methods. A method is a function associated with an object.

        Definition: An object is a software bundle of variables and related methods.

        Classes

        In object-oriented software, it’s possible to have many objects of the same kind that share characteristics: rectangles, employee records, video clips, and so on. A class is a software blueprint for objects. A class is used to manufacture or create objects. The class declares the instance variables necessary to contain the state of every object. The class would also declare and provide implementations for the instance methods necessary to operate on the state of the object. Definition: A class is a blueprint that defines the variables and the methods common to all objects of a certain kind.

        [php]
        public class CoffeeCup {
        private int innerCoffee = 0;
        public void addCoffee(int amount) { // a method
        innerCoffee += amount;
        }
        public int releaseOneSip(int sipSize) {
        int sip = sipSize;
        if (innerCoffee < sipSize) {
        sip = innerCoffee;
        }
        innerCoffee -= sip;
        return sip;
        }
        public int spillEntireContents() {
        int all = innerCoffee;
        innerCoffee = 0;
        return all;
        }
        }
        [/php]

        Download code here

        Prev Object Oriented Programming
        Next Java Inheritance

        All Courses

        • JAVA TECHNOLOGIES

        Latest Courses

        Core Java

        Core Java

        Free
        JDBC

        JDBC

        Free
        logo-eduma-the-best-lms-wordpress-theme

        contactus@tech2our.com

        Company

        • About Us
        • Blog
        • Contact

        Links

        • Courses
        • Events
        • FAQs

        Support

        • Documentation
        • Forums
        • Language Packs

        Copyright © 2012-2017 Tech2Our.com. All Rights Reserved.

        • Privacy
        • Terms
        • Sitemap