Java
  Home arrow Java arrow Java and Object-Oriented Programming
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Java and Object-Oriented Programming
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2007-09-19


    Table of Contents:
  • Java and Object-Oriented Programming
  • How State and Behavior Affect One Another
  • Class, Inheritance and Interface
  • All About Variables

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Java and Object-Oriented Programming
    ( Page 1 of 4 )

    In the olden days, not only did we have to walk a mile in the chilling winds of a snowstorm to get to school (hey our grandparents had it rougher; they had to do it to get to day care), we also had to make programs without buttons and scrollbars. Now, of course, we have object-oriented programming. This article will introduce you to the most important concepts as they relate to Java.

    There are five basic concepts employed in object-oriented programming (hereinafter referred to as OOP). I will cover the basics of each category and how they relate to the programming process.

    Objects

    To keep it simple, an object is an abstract representation simulating everyday objects around you. If you are using Windows, or any application designed during the mid-nineties and beyond, you have seen them thousands of times. They come in a variety of forms: buttons, pull-down menus, scrollbars, that little garbage can that you try your best to fill but never seem able to. Those are all objects, and despite their digital appearance, they like to be treated as such.

    What do I mean by that? No, you can't physically press a button on a computer screen, let alone set a digital trash can out by the curb to be manhandled by your sanitation engineers. Objects have two characteristics about them. These are state and behavior. I'll discuss both of these in further detail.

    State

    Florida, Virgina, Idaho...these are all examples of states. Unfortunately, they are the wrong example. State, at least in programming terms, describes the object. If I were to say my girlfriend was an object (which I wouldn't unless I really wanted her to become my EX-girlfriend), I could then describe her state in the following fashion: red-haired, Caucasian, her name. Maybe she is annoyed at me for not taking out the garbage. That could be a state also. In the same way, objects in programs have similar states. Any given object can have a different number of states. The television, for instance, has an on state and an off state. A person, on the other hand, can have innumerable states. They can be awake, asleep, hungry, tired, bored, and so forth.

    Behavior

    The other characteristic an object possesses is a behavior. You could view this as what the object does once you change its state. If my dog was an object, there would be a variety of behaviors it could exhibit. It could eat, sleep, sit, stand, roll over, play dead, and stay (which is pretty unlikely when the mailman is at the door). And just as objects can have multiple states, so too can they have a plethora of behaviors, or even just one.



     
     
    >>> More Java Articles          >>> More By James Payne
     

       

    JAVA ARTICLES

    - Exception Handling Techniques in Java
    - More About Multithreading in Java
    - The Basics of Multiple Threads in Java
    - Data Access Using Spring Framework JDBC
    - New Object Initialization in Java
    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT