[Theory] A simple but hard question about OO programming

I was in my first class of OO programming (4th year of computer engineering in Valencia) and the professor gave us homework.
The homework was a simple question about OO programming (it is not about a specific language, though we are going to use Java in the practice sessions), we shall find an answer to it and discuss it in class the next day.
The question was:
"May classes also be objects?"
which can be said as:
"May classes be instances of an(other) classes?"
I hope that you, archers, can enlighten me in this question

tvale wrote:I believe an object is an instance of a class.
Yup, that's true. Let's see... An object is an instance of a class, so we can have a lot of objects coming from one class.
We can say an object is not a class because it has a state (think about a light, it has a state: on or off, but a class light is not on/off, because in a class we just describe the behavior that class should have.
But what we're asking here is if a class can have a state. I think it may refer to static properties about the objects.

Similar Messages

  • Question about the programming of a legend

    Hello everybody,
    I have a question about the programming of a waveform's legend. I
    already asked here in this forum about the legend programming (03)
    months ago.
    I went satisfied but I ve just noticed that this code
    (See Code old_legend_test.llb with main.vi as main function) operates a
    little different from my expectances.
    Therefore I have a new question and I want to know if it
    is possible by labview programming to plot and show, on a waveform
    chart, a signal with activ plot superior to zero (0) without to be
    obliged to plot and show a signal with activ plot equal to zero (0) or
    inferior to the desired activ plot.
    I give you an example
    of what I m meaning. I have by example 4 signals (Signal 0, 1, 2 and 3)
    and each signal corresponds respectively to a channel (Chan1, Chan2,
    Chan3, Chan4). I want to control the legend (activ plot, plot name and
    plot color) programmatically. Is it possible with labview to plot signal
    1 or 2 or 3 or (1, 3) or (2,3) or (1,2,3) or other possible combination
    without to active the signal with the corresponding activ plot zero
    (0)?
    Let see the labview attached data
    (new_legend_test.llb with main.vi as main function). When I try to
    control the input selected values again I get them back but I don't
    understand why they have no effect on the legend of my waveform chart.
    Could somebody explain me what I m doing wrong or show me how to get a
    correct legend with desired plots? Thank by advance for your assistance.
    N.B.
    The
    both attached data are saved with labview 2009.
    Sincerly,PrinceJack
    Attachments:
    old_legend_test.llb ‏65 KB
    new_legend_test.llb ‏65 KB

    Hi
    princejack,
    Thanks for
    posting on National Instruments forum.
    The behavior
    you have is completely normal. You can control the number of row displayed in
    the legend and this rows are linked to the data you send to your graph. Thus,
    if you have 3 arrays of data, let say chan1, chan2 and chan3, you can choose
    which data you want to display in your graph using the property node (Active
    plot and visible). But for the legend as you send 3 plots there is an array of
    the plot name [chan1, chan2, chan3] and you can display 0, 1, 2 or 3 rows of
    this array but you cannot control the order in this array! So, to be able to
    change this array you have to only send data you need to you graph. I'm not
    sure my explanations are clear so I have implemented a simple example doing
    that.
    Benjamin R.
    R&D Software Development Manager
    http://www.fluigent.com/
    Attachments:
    GraphLegend.vi ‏85 KB

  • Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hi ,
    You might want to refer the following link to find your serial number and activate your software .
    Here is the link for the same.
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Let us know how it goes .We'll do the best possible to get your issue fixed.
    Regards
    Sukrit Dhingra

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • Question about DNS programing

    hi, i am creating a DNS query message,
    but when i send out my package, in wirshark i capture that in my package the question is unknow
    my package carry a domain name like "www.sun.com"
    and send to one of the root dns using type a.
    but the question is that,
    i have to convert the "www.sun.com" into byte array
    what i did is "www.sun.com".byteValue,
    and directly put it into the question part of my dns query.
    seems this part causing the problem, i can not directly convert the string into byte,
    have to follow some rule
    Does anyone know how to do that?

    en.....becuase i want to wirte some code like getbyName does..hoho
    i find out finially
    03www03sun03com
    because
    length of www is three, so there is a "3" infornt

  • Very simple and quick question about Arrays

    Hi,
    I have the following code to produce a student grades provessing system. I have got it to store data in the array, i just cant figure out how to add the integers from the row to produce a total. Thats all I want to do create a total from the 6 marks and add a percentage.
    Any help would be greatly appreciated.
    -------------CODE BELOW----------------------
    import java.util.*;
    public class newstudent1_2
    public static void main (String[]args)
    System.out.println ("-----------------------------------------------"); //Decorative border to make the welcome message stand out
    System.out.println (" Welcome to Student Exam Mark Software 1.2"); //Simple welcome message
    System.out.println ("-----------------------------------------------");
    int [][] mark;
    int total_mark;
    int num_students;
    int num_questions = 9;
    Scanner kybd = new Scanner(System.in);
    System.out.println("How many students?");
    num_students =kybd.nextInt();
    mark = new int[num_students][num_questions] ;
    for (int i=0; i<num_students; i++)
    System.out.println("Enter the Students ID");
    String student_id;
    student_id =kybd.next();
    System.out.println("Student "+i);
    for( int j=1; j<num_questions; j++)
    System.out.println("Please enter a mark for question "+j);
    mark[i][j]=kybd.nextInt();
    System.out.print("id mark1 mark2 mark3 mark4 mark5 mark6 mark7 mark8");
    //This section prints the array data into a table
    System.out.println();
    for (int i=0; i<num_students; i++)
    for( int j=0; j<num_questions; j++)
    System.out.print(mark[i][j]+"\t"); //the \t is used to add spaces inbetween the output table
    System.out.println();
    --------------END OF CODE---------------
    Thanks.

    I had to do this same sort of thing for a school assignment but i didnt use an array.
    import java.text.DecimalFormat;
    import TurtleGraphics.KeyboardReader;
    public class grade_avg
         public static void main(String[] args)
              int grade, total = 0, count = 0;
              double avg = 0.0;
              KeyboardReader reader = new KeyboardReader();
              DecimalFormat df = new DecimalFormat("0.00");
         for (;;)
                   grade = reader.readInt("Please enter a grade: ");
              if (grade > 0)
                        total = total + grade;
                        count ++;
              if (grade == 0)
                        avg = total / count;
                        System.out.println("The average is: " + df.format(avg));
                        System.exit(0);
    }output looks like:
    Please enter a grade: 100
    Please enter a grade: 50
    Please enter a grade: 0
    The average is: 75.00

  • Want to upgrade to Mountain Lion, but CS6 questions about Auto-Save need answers...

    Hi,
    I'm on Mountain Lion for all my "non-critical" work, but I'm still running the latest Snow Leopard on my main desktop machine, running CS6 Design & Web Premium. I've avoided the switch primarily because of the auto-save feature that Apple placed into ML. I haven't found a satisfactory answer anywhere on the web to this basic question...is auto-save a problem, as Apple implements it, with CS6 and working on images?
    In particular: 1. I work on very larger files, 4GB+ in size regularly, and I don't wan't the peformance hits associated with constant saving, 2. I make changes to images, downsizing them, croping, color corrections, etc. so that I can make jpg proofs for clients or myself. These are more "intermediary" images and not intended to be saved. I don't want to downsample an image, flatten it to creat a jpg for proof and have it overwrite the original image layered, high res by mistake. Does this happen with photoshop, or does Adobe avoid the auto-save that Apple uses?
    I have all the latest iOS gadgets and it's becoming quite cumbersome managing multiple sets of iCloud info, etc. without being on ML. I'd like to make the switch, but at the cost of losing work, etc. Can someone with experience on ML & CS6 give me any input in the matter? And, does this also apply to all the other Adobe apps in CS6? I'm constantly making minor changes and edits that I usually "undo" out of and don't want saved.
    Thanks.
    Craig

    So, in other words, photoshops behavior works the same, using save as..., etc. as it did under Snow Leopard? I should expect the auto-save behavior that occurs in apps like iPhone, etc., where i can actually lose the original because of the constant backups, etc.?
    Thanks.

  • Simple, but dumb, question

    My wife wants to copy a cassette tape to her G4 laptop. Is GarageBand the right application to digitize an analog source? I looked at the Apple page on GarageBand and didn't see anything that helped.
    Thanks.

    You can use simpler programs than GB, but GB will do it:
    http://www.bulletsandbones.com/GB/FAQPages/RecordCassette.html

  • Simple but necessary question

    I have noticed my computer fans running more so when the unit is hooked up to the internet WITHOUT any extra applications running (i.e. Safari)as when unpluged yet running with the same CPU demands.
    In other words:
    When I'm at work, (no internet hook up), and the computer is sitting idle but not asleep, the fans hardly kick in, yet, in the same situation, but at home HOOKED to Cable Net but still running idle, the fans kick in every once in a while.
    Is this to be expected?

    neuroanatomist
    thank you again for the prompt answer.
    As far as I can recall, I did the diagnostic you recommended with the activity monitor and nothing appeared too extensive.
    I think I will attempt it again and hopefully, either find my answer, or ask for your advice again if negative.
    Thank you
    Ralph

  • SOS!! Simple yes/no question about JPA...

    Hello,
    I have the following environment and requirements:
    -Tomcat 5.5 (no ejb container)
    -Latest version of Hibernate
    -JSF 1.1
    -A requirement to use JPA
    -I must use the query cache and the second-level cache
    My question is as follows:
    What is the best solution?
    Solution 1.
    ONE EntityManagerFactory stored in the ServletContext for use by all of my web app users generating MULTIPLE INSTANCES of EntityManagers. (would this allow me to use the query cache?)
    Solution 2.
    ONE EntityManagerFactory and ONE EntityManager stored in the ServletContext for use by all of my web app users.
    Thanks in advance,
    Julien.

    Regarding caching, what exactly are you referring to
    by "query cache"? Are you saying you
    plan to execute the same query multiple times but
    you'd like the underlying persistence manager
    to avoid trips to the actual database? Whether the
    query is executed by an actual database
    access or is fulfilled through some JVM-local cache
    is not controlled by the spec. Most implementations
    do allow for such caching but the behavior is
    persistence-provider specific.Yes. I am actually using hibernate behind the scenes as my persistence framework.
    I'd suggest looking at the presentation from last
    year's JavaOne called "Persistence In the
    Web Tier"
    http://developers.sun.com/learning/javaoneonline/2006/
    webtier/TS-1887.pdfI am going to have a look at that.
    Thanks again.
    Julien.

  • Ctrl- T works fine but some questions about tweaking

    1) Is it possible to change the number displayed (9)?
    2) Can I keep some, as they get overwritten. When does this happen? Time? How many times I've gone to that site? How many times is that?
    I presently use my Favorites Bar and Groups as needed. I like the ease of use of Ctrl-T and was wondering.
    I did try searching Help but nothing is broken. I'll keep trying though.
    Thanks!

    hello DrDOS, in fact it will be possible in the next version, firefox 17, to change the number of thumbnails shown (one can enter '''about:config''' into the location bar & tweak the preferences browser.newtabpage.columns & browser.newtabpage.rows). if you want you can [https://www.mozilla.org/firefox/beta/ download the beta version] which already includes the feature.
    the list of sites shown gets populated by a mixture of frequent visits & recent visits (similar like the suggestions from the locationbar - mozilla calls that the [https://developer.mozilla.org/en-US/docs/The_Places_frecency_algorithm frecency algorithm]).
    however you can also customize the sites shown on the new tab page by draging and pinning entries from the history/ bookmarks library onto the page.
    [[New Tab Page – show, hide and customize top sites]]

  • Simple but elusive question

    I have a master/detail form. Upon updating a row in the detail block, I need to update a table which is different from both the master and detail tables. so far the insert and delete operations are working fine (I use post_insert and post_delete), but the problem is when I try to do an update because the pre_update and post_update triggers deal with the new value for the updated row. How can I handle the situation where there is an old/new value?

    The best way to handle something on a table where you need the old and the new-values would be a database-trigger. Also for reasons of data-consistency a database-trigger would be the better solution (its always executed, not just for dml coming form a specific forms-module).
    If you still want to do it the forms-way there are two possibilities:
    Use a POST-UPDATE-trigger and get the old-values via GET_ITEM_PROPERTY('BLOCK.ITEM', DATABASE_VALUE);
    Use a PRE-UPDATE-trigger and read the data directly from the db-tables via a select.

  • Help with a simple but crazymaking question!

    hi there, would anyone here mind looking at my test site and
    telling me what I am doing wrong?
    http://presentations.patrickmeyers.com/
    I am VERY new at anything web related, and trying to learn
    some Dreamweaver, html, and css. Basically I want ALL my content
    (which for now is just images) to stay flush left with each other
    no matter what the user does with their web browser window. But
    when I expand my web broswer window, two of my images (one of which
    is a rollover image that I need to add a hyperlink to) bump over to
    the right and up. I don't want them to do that! I want them to stay
    flush left at all times.
    I also want to center everything so that no matter what a
    person does with their browser, the page stays in the center of the
    window (i.e. the Yahoo homepage) but all the content remains left
    aligned relative to the top.
    I've tried every concievable setting in Dreamweaver I can
    think of and nothing works. The button and bottom banner still move
    over to the right and up.
    Any tips? Thank you in advance!!!!!
    p

    <p><img src="banner.jpg" width="792" height="336"
    align="left" /><a href="#"
    onmouseout="MM_swapImgRestore()"
    onmouseover="MM_swapImage('Image3','','click-button-yellow.jpg',1)"><img
    src="click-button-purple.jpg" name="Image3" width="180"
    height="46"
    hspace="16" vspace="15" border="0" align="left" id="Image3"
    /></a></p>
    <p><img src="lowerbanner.jpg" width="792"
    height="41" vspace="30"
    align="left" /></p>
    </body>
    You have two elements horizontally adjacent (the banner image
    at 792px
    width, and the anchor tag at 180px width). Their combined
    width is
    792+180+32px = 1004px (the 32px comes from the hspace="16"
    attribute). When
    the browser viewport is less than 972px wide, the anchor tag
    and its
    associated image will just drop below the banner image (since
    they are
    contained in a <p> that has no explicit width).
    Change this -
    <p><img src="banner.jpg" width="792" height="336"
    align="left" /><a href="#"
    onmouseout="MM_swapImgRestore()"
    onmouseover="MM_swapImage('Image3','','click-button-yellow.jpg',1)"><img
    src="click-button-purple.jpg" name="Image3" width="180"
    height="46"
    hspace="16" vspace="15" border="0" align="left" id="Image3"
    /></a></p>
    to this -
    <p style="width:1004px;"><img src="banner.jpg"
    width="792" height="336"
    align="left" /><a href="#"
    onmouseout="MM_swapImgRestore()"
    onmouseover="MM_swapImage('Image3','','click-button-yellow.jpg',1)"><img
    src="click-button-purple.jpg" name="Image3" width="180"
    height="46"
    hspace="16" vspace="15" border="0" align="left" id="Image3"
    /></a></p>
    and see what happens.
    > I also want to center everything so that no matter what
    a person does with
    > their browser, the page stays in the center of the
    window (i.e. the Yahoo
    > homepage) but all the content remains left aligned
    relative to the top.
    It depends on whether you are using absolute positioning on
    the page, as to
    which method might be best, but in either event, this will
    work -
    Change this -
    </head>
    to this -
    <style type="text/css">
    #wrapper { width:1004px; margin:0 auto;position:relative; }
    /* 760px will display on an 800px screen maximized browser
    window without */
    /* horizontal scrollbars. 1004px is pretty wide, and will
    display horizontal
    scrollbars on 1024 screens.*/
    </style>
    </head>
    change this -
    <body
    onload="MM_preloadImages('click-button-yellow.jpg')">
    (the ellipsis represents any other attributes that might be
    mentioned in the
    body tag, and SHOULD NOT BE INCLUDED EXPLICITLY!)
    to this -
    <body
    onload="MM_preloadImages('click-button-yellow.jpg')">
    <div id="wrapper">
    and this -
    </body>
    to this -
    <!-- /wrapper -->
    </div>
    </body>
    and see if that helps.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "patrickpmm" <[email protected]> wrote in
    message
    news:[email protected]...
    > hi there, would anyone here mind looking at my test site
    and telling me
    > what I
    > am doing wrong?
    >
    http://presentations.patrickmeyers.com/
    >
    > I am VERY new at anything web related, and trying to
    learn some
    > Dreamweaver,
    > html, and css. Basically I want ALL my content (which
    for now is just
    > images)
    > to stay flush left with each other no matter what the
    user does with their
    > web
    > browser window. But when I expand my web broswer window,
    two of my images
    > (one
    > of which is a rollover image that I need to add a
    hyperlink to) bump over
    > to
    > the right and up. I don't want them to do that! I want
    them to stay flush
    > left
    > at all times.
    >
    > I also want to center everything so that no matter what
    a person does with
    > their browser, the page stays in the center of the
    window (i.e. the Yahoo
    > homepage) but all the content remains left aligned
    relative to the top.
    >
    > I've tried every concievable setting in Dreamweaver I
    can think of and
    > nothing
    > works. The button and bottom banner still move over to
    the right and up.
    >
    > Any tips? Thank you in advance!!!!!
    > p
    >

  • Really easy, but confusing question about SW installation.....

    Hello:
    I have a pc desktop (Win XP Home SP 2) and a new HP wireless laptop I want to connect with my new WRT54GS.
    Question.....When I open the box, it says "STOP - LOAD THE CD FIRST".
    Ok, fine. Load the cd where????? Desktop (wired to router), laptop, or both?????
    Thanks for answering a silly question.
    William Hollingsworth

    Is your PC going to be wired or wireless? Anyway, set-up CD usually does not work properly. Connect a PC directly to the modem and go to www.linksys.com/easy and run the EasyLink Connect Tool.

  • Pretty simple but annoying question for newbie

    when opening form is there a way to automatically display the
    record rather than having to hit F8.
    also....
    is there a way to navigate through records using PL/SQL rather
    than using the buttons on the tool bar at the top or form
    runtime.
    thanks in advance

    This is probably in the wrong forum. ;)
    Anyway, here's my suggestions for your two queries:
    Q1) Add a WHEN-NEW-FORM-INSTANCE trigger containing the
    following statement:
    EXECUTE_QUERY ;
    Q2) Use the up and down arrow keys - they navigate between the
    previous and next records respectively.
    HTH

Maybe you are looking for

  • Is Adobe Exchange feature supported on CS5.* ?

    Hi! I am developing a Flex panel for Photoshop CS5.* and 6 using Creative Suite Extension Builder 2. This version has  a new feature called Adobe Exchange that allows extensions to be marketed and sold. As I understand, this feature is supported on C

  • 1st April 2012 problem

    When I try to create an all day event on 1 Apr 12 on my iPad, the length of the event is automatically converted to two days long. When I edit the event, it remains at two days long. I changed my regional settings in order to change the first day of

  • Currency Conversion at Query Level

    Guys, Can some one tell me step by step procedure to do Currency conversion from USD to Mexican PESO at query level in BI 7.0. I have read lot of threads but not clear in maintaining the Exchange rates and also in creating the variables.  Thank you,

  • QT Pro Registration

    I ordered QT Pro from the Apple Webstore tonight. I was charged 29.99 + tax and received the confirmation e-mail. But the problem is, there was no registration code included in the e-mail (it does state the product is registered to me). I have looked

  • After software update my Nokia E51 has lost intere...

    Yesterday I did for the first time my Nokia E51 software update. I followed after instruction, update has installed properly. After update I backed up my phone data and settings. But there is one problem. After update my phone lost internet connectio