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

 
Developer Updates  
Free Website Content 
OLM
 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: 5 stars5 stars5 stars5 stars5 stars / 8
    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:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    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


       · Hope you guys enjoyed this article on Java and Beginning Object Oriented...
     

       

    JAVA ARTICLES

    - 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...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup
    - Using RPC-Style Web Services with J2EE
    - Integrating XML with J2EE
    - Taming Tiger: Concurrent Collections
    - Combating the ‘Object Crisis’

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway