Procedual and OO programming ???

i have just started learning java, i haven't done any programming before and i was wondering if someone could descride the diffrence between Procedual and OO programming, and maybe if its possibable give me a simple program in OO and the same program in Procedual?
so i can compare
thanks
Ant

Well, in procedural programming its kind of like writing a big list of things to do, all in a row, one thing after another ...like do this, then this, now go check this, then if that is done, go do this ...until you achieve the desired result. Once you are done, all those 'procedures' you wrote are locked into the program you just built, and the next time you start over making your program from scratch all over again (ok, you can copy paste ...but that's not very efficient) To track data for a set of people you have to maintain reams of data in more or less global variables, and pass this data around when you want to work on this group of people.
Now with oop, you will more or less write the same kind of syntax ...but you will use oop techniques and abilities to organize your code so that it becomes reusable by other programs. Its kind of akin to organizing your code a certain way. In the procedural style ...you can write the same functionality a million different ways, with stuff all disjointed and scattered throughout your program. However, with oop techniques, you try to make an intelligent object that can 'do its job in and of itself' ...almost independent of the program you wrote it for.
For example, with class Person, we would write a class that stores info about eye color, hair style, sex, etc, etc. We give the class its own methods such as getThoughts(), isSleeping() etc, etc. Because this is an object, we can make person after person after person ...and we don't have to track anything about the different paople. The class handles all this internally, and we can forget about it. The data is encapsulated inside the class and protected from access (unless we specifically go retreive it) from the outside program. When we want to get the thoughts for a person we have created, we just call getThoughts() and count on the code inside of each different person object to act on its data, compute the results for us, and give it back.
The best part is when you write another program, you just reuse the person class again. No rewriting of code. If you want to add a bit of customization to your people for this program ...you can inherit (or extend) the original person class to take advantage of its basic features, and add your customized functionality in your subclass. This saves time, and saves debugging too. If the person class is tested and debugged ...we avoid screwing it up by not rewriting the same code all over again. We just use the prebuilt person object we made last year.
Hope this sheds a few lights. Others ...please feel free to add or complain. Its not something you explain conceptually in a couple of words or even paragraghs !!
GumB.

Similar Messages

  • Ipod not recognized by windows and causes programs to crash

    for some reason my ipod is acting weird. the other day it froze an so i restored it and it was working fine. now i connected it to my firewire (my ipod is a click wheel one) and when i hooked it up to my firewire to update on itunes, i noticed that like all of my windows that were open started to freeze including itunes. when i disconnected the ipod everything works fine. and now i cant restore the ipod because its not recognized by my computer. i put it in disk mode but when i hook it up to the firewire, it doesnt show on my computer and my programs freeze.
    can someone please help me. i couldnt try the 5 r's or whatever because the ipod freezes when connected. and i tried http://discussions.apple.com/thread.jspa?threadID=461952&tstart=75
    but it didint work cuz i waited like 10 minutes after hooking up my ipod and it stil was not being recognized.
    please please help me someone
    custom   Windows XP  

    thanks for the info guys, ive never used my ipod on a mac (not that im aware of) and i would try using the usb but my computer does not have that 2.0 high speed usb thing so im forced to use the firewire. its weird cuz yesterday i uninstalled itunes and the ipod and when i installed everything, my computer recognized the ipod and it updated but now its doing the same thing again. dont nkow what the problem is? u guys think its the firewire?

  • I  used to have an OLD Photoshop cd but it has been lost and my program is no longer on cd. I talked with some photographer friends and this is what one of them told me to get: Adobe Photoshop Lightroom and CS CC... HELP please?

    I  used to have an OLD Photoshop cd but it has been lost and my program is no longer on cd. I talked with some photographer friends and this is what one of them told me to get: Adobe Photoshop Lightroom and CS CC... HELP please?

    If you still have your serial number, look at OLDER previous versions http://www.adobe.com/downloads/other-downloads.html
    Otherwise, the US$ 9.99 plan is what is current at Cloud Plans https://creative.adobe.com/plans

  • What is difference between report programming and dialog programming?

    hi,
    what is difference between report programming and dialog programming? plz provide some example code
    bye

    ABAP programming
    Basically reports are used to read database and represent the results in lists.
    Reports are collections of processing blocks that the system calls depending on events.
    We can use reports to evaluate data from database tables.
    Reports are stand alone programs and controlled by events.
    A report itself never creates events
    steps in report:
    Processing the selection screen
    Reading the database
    Evaluating the data and creating lists
    Outputting a list.
    1st u write simple logics, after that u can enhance the code as step by step.
    http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/index.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
    http://www.sapdev.co.uk/reporting/reportinghome.htm
    Dialog Programming
    Structure of a Dialog Program
    A dialog program consists of the following basic components:
    Screens (dynpros)
    Each dialog in an SAP system is controlled by dynpros. A dynpro (DYnamic PROgram) consists of a screen and its flow logic and controls exactly one dialog step. The flow logic determines which processing takes place before displaying the screen (PBO-Process Before Output) and after receiving the entries the user made on the screen (PAI-Process After Input).
    The screen layout fixed in the Screen Painter determines the positions of input/output fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
    ABAP/4 module pool
    Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
    All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
    Check this link for basics.
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    Check this link for Dialog Programming/Table Control
    http://www.planetsap.com/Tips_and_Tricks.htm#dialog
    Check this SAP Help for Dialog Program doc.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    Check this SAP Help link for Subscreens.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
    Check this link for subscreen demo program.
    http://abapcode.blogspot.com/2007/05/demo-program-to-create-subscreen-in.html
    Also check this link too.
    http://abapcode.blogspot.com/2007/06/dialog-programming-faq.html
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld004.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ccf35c111d1829f0000e829fbfe/frameset.htm
    http://abapprogramming.blogspot.com/

  • While having a perfectly running iTunes and all programs associated, I was notified of the iTunes 10.4 upgrade. After following typical directions, I have had nothing but trouble. First "iTunesHelper was not installed correctly. Please reinstall iTunes. E

    While having a perfectly running iTunes and all programs associated, I was notified of the iTunes 10.4 upgrade. After following typical directions, I have had nothing but trouble. First “iTunesHelper was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 5)” occurred. Following directions found at https://discussions.apple.com/message/15087646#15087646, I now get the following “iTunes.exe - System Error The program can't start because AVFoundationCF.dll is still missing from your computer. Try reinstalling the program to fix this problem.”, Along with “iTunesHelper was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 126)” I am running Win 7 Ultimate 64 bit on HP TouchSmart tx2-1275dx. I was one week away from buying an iPad but not if this is what I have to deal with. Please help

    I actually managed to resolve this on my own by downloading iTunes from the Apple website and reinstalling iTunes that way. Here's the link: http://www.apple.com/itunes/download/ That should fix your problem. Good luck!

  • My computer crashed necessitating re-install of op sys and all programs including iTunes. At the iTunes store when I click a song in my library get error message "can't find, do you want to search?" What's happening? How can I listen to my library on this

    My computer crashed necessitating re-install of operating sys and all programs including iTunes. When I click on a song in my library I get an error message "can't find this song, want to search?" What gives? How can I listen to songs in my library on this computer now?

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • Cannot uninstall I tunes. In control panel add and remove programs it will not give me the option to remove any of the I tunes. In program files it tells me access denied to remove any of the related items. I have tried using the removal methods from i tu

    My i tunes will not work at all. I have tried all the steps given to remove my I tunes player but in my control panel, add and remove programs it does not give me an option to remove any of the apple/ I tunes. I tried to go to program files and remove all the files but access is denied. This all started about 1 1/2 years ago and with every i tunes update i got more and more errors or problems until it stopped working. At one time i could remove and reinstall i tunes to try to fix it but now i cannot do anything. I believe one of the last  was i could not open i tune because it was being used or was on another network, not 100% sure its been so long and frustrating I quit trying 6 months ago. Hopefully someones got some help !!!
    Thanks I appreciate your time; Philip

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Is there a remote app that will let me open and close programs on my iMac

    Hi There,
    I know that I can use the Apple Inc "Remote App" to control my iTunes on my iMac - and I really like it for when I am not right at my computer, but I have to have iTunes open on my iMac before I can use it which is a bit of a pain to have to think "Am I going to use iTunes today?" or to run off to my office at the other end of my house when I decide I want music through my speakers and so my question is thus.
    Is there a remote app that I can download for iPhone or even iPad lets you open and close programs on your iMac when you are not actually sitting at it. So say I want to open iTunes on my iMac i would do the following
    1: Open the remote app on my device (either iPhone or iPad)
    2: See a representation of iMac screen on that device (cut down for iPhone)
    3: Chose the program I want (iTunes in this case) and it will open on my iMac allowing me to begin using the program remotely on my remote device.
    I am not talking about remote desktop or anything here (I don't want to do complicated things on it) just be able to open programs like iTunes so I can have the music play through my home speaker system without having to have all of my programs already running on my mac incase I decide to use them
    Message was edited by: Jason G Telford: Posted the question accidentally so I had to edit it with the right title

    this question has just been marked as answered to clear it from the unresolved questions list

  • I cannot open my firefox broswer. The message box appeared that said a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available. Under that there are debug and close program buttons.

    I cannot open my firefox broswer. The message box appeared that said a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available. Under that there are debug and close program buttons.

    JackieMars71 I would recommend reviewing your installation log files to determine if there are any errors during the installation process.  You can find information on how to locate and interpret your installation log files at Troubleshoot install issues with log files | CC - http://helpx.adobe.com/creative-cloud/kb/troubleshoot-install-logs-cc.html.  You are welcome to post any specific errors you discover to this discussion.

  • Names of interface tables and interface programs of oracle modules

    Hi all,
    i need urgent and accurate information about the names of interface tables and interface programs of the following oracle modules,R12, or either ther are custom made. Any accurate link refering to the desire information would be much appreciated.
    Plus i need a clear and simple definition and purpose of interface tables and interface program and by what other names are they known in industry.
    Data Object,Oracle Module
    Chart of Accounts,Oracle General Ledger
    Trial Balance,Oracle General Ledger
    Supplier Master,Oracle Payables
    Open Supplier Invoices,Oracle Payables
    Open Supplier Credit/ Debit Memos,Oracle Payables
    Open Supplier Advances,Oracle Payables
    Bank Master,Oracle Cash Management
    Customer Master,Oracle Receivable
    Asset Categories,Oracle Assets
    Asset Master,Oracle Assets
    Item Master,Oracle Inventory
    Item Categories,Oracle Inventory
    Sub Inventory and Locators,Oracle Inventory
    Item On Hand Balances,Oracle Inventory
    Item wise Per unit Cost,Oracle Inventory
    Bill of Material,Oracle Discrete Manufacturing
    Departments,Oracle Discrete Manufacturing
    Operations,Oracle Discrete Manufacturing
    Routings,Oracle Discrete Manufacturing
    Resources,Oracle Discrete Manufacturing
    Overheads,Oracle Discrete Manufacturing
    Employee Master,Approval Hierarchy
    Approval Hierarchy,Approval Hierarchy
    Open Customer Invoices,Oracle Receivables
    Open Customer Credit/ Debit Memos,Oracle Receivables
    Open Customer Advances,Oracle Receivables
    Pending Requisitions,Oracle Purchasing
    Pending Purchase Orders,Oracle Purchasing
    Open Sales Orders,Oracle Order Management
    Price List,Oracle Order Management

    Hi;
    Its metalink note you need to login metalink wiht valid CSI(customer Support Identifier) number to can se note via using note number.
    Please see:
    Oracle EBS Based and Interface tables
    Oracle EBS Based and Interface tables
    Regard
    Helios

  • My microsoft word and excel programs won't work and files won't open.

    After an automatic HP update, my Microsoft Word and Excel programs won't work and my files won't open.  What caused this and what can I do to fix the problem without losing my files?  I have files that are part of my work and I HAVE to have them ASAP.  Please help.
    Thanks in advance.

    Hi
    Please find the steps to resolve your issue.
    Open Installed Updates by clicking the Start button , clicking Control Panel, clicking Programs, and then, under Programs and Features, clicking View installed updates.
    Click the update that you want to remove, and then click Uninstall.  If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
    Or Try this step
    If this does not resolve your issue then you can try a System restore to the date where unit was working fine steps provided below for you.
    Start in search box type System Restore then click on it then select the Date where unit was working fine.
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • I get an error message saying "The iTunes Library.itl file cannot be found or created" when I try to open iTunes on my computer and the program fails to open.   How can I fix this?

    When I try ot open iTunes on my computer I get an error message stating "The iTunes Library.itl file cannot be found or created" and the program fails to open.  How can I fix this issue?

    Hi pgarard1,
    If you are having issues with launching iTunes after an update, you may want to take a look at the troubleshooting in the following article:
    iTunes for Windows: Doesn't open after upgrading in Windows Vista or Windows 7
    http://support.apple.com/kb/TS2363
    Regards,
    - Brenden

  • SAFARI AND OTHER PROGRAMS ENDING UNEXPECTEDLY??

    Safari and other programs are ending unexpectedly, vuze is also doing it during downloads????
    any solutions?

    "...but it does it on multiple internet connections.... "
    What does that mean? I suggested you have a problem with your ISP and/or internet service. Have you checked those out?

  • I just updated iTunes on my dell and now when I try to go to the store I get an error message that iTunes has stopped working and the program closes. Ideas?

    I just updated iTunes on my dell and now when I try to go to the store I get an error message that iTunes has stopped working and the program closes. Ideas?

    I have also retarted twice...

  • When I tgry to drop a video from the main screen to a time line with no secuence i receive an error with no number, just tell me the progran stop working and the program closes can you help me please

    please someone who help me please
    when I tgry to drop a video from the main screen to a time line with no secuence i receive an error with no number, just tell me the progran stop working and the program closes

    You need to help us first ...
    Computer specs:
    OS, CPU, RAM, GPU, vRAM ... and also disc layout & connections can be useful (as in, "2 internal hard-drives and an external on Thunderbolt connection for exports")
    Program specs:
    Specific build of Premier Pro from the bottom of the "About" splash screen off the "Help" menu is best.
    Footage file type: MXF, AVCHD, MOV, m2s, what?
    Even the camera it was shot on can be of interest at times.
    And did you use media browser to import, then project panel to drag & drop?
    Neil

Maybe you are looking for

  • The ipod cannot be synced. The disk could not be read from or written to.

    i get that error when trying to sync songs to the ipod, someone know how to fix it? my ipod is running 3.0 , im using itunes 9, and im running Vista Home Basic

  • ITunes on iPhone 5 not working

    Ever since updating to IOS 7 I haven't been to access the itunes store on my phone. The App store works perfectly but the itunes store loads and remains blank, not even my purchases are available to see! I was wondering if I'm not the only one who is

  • Preloading in Flash CS3/Actionscript 3

    I am wondering if anyone know why this is happening: I built a preloader based on code from the net. Once the preloader plays through (in simulated download) it opens to the first "stop();" in the MC timeline instead of starting at frame 1. Here is t

  • HT1296 I'm trying to sync my Mac calendar (OS X Mavericks10.9) to my iPhone 5c.  Help?

    I have iCloud set up, but I'm not sure how to go about syncing the Mac Calendar to my iPhone.  The calendar on my iPhone has my yahoo account synced to it and also has a section for iCloud. I've tried to add the On My Mac calendar to the Icloud secti

  • Running iTunes from server as a service?

    I have itunes running on a windows server that i would like to use for sharing/streaming to clients on the network. I can turn itunes on once i'm logged in (via remote desktop) and it will work fine, but it eventually logs me off and therefore looses