What does this mean??

Discussion in 'Java' started by freesoft_2000, Nov 1, 2005.

  1. Hi everyone,

    I have two rather silly questions so please bear with me

    what does the below code
    mean

    Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a :
    a.getBounds();

    Could someone translate the above code into simple java codings so i can
    understand it

    And finally what does the below code mean

    x*= 0.5

    Could someone also translate the above code into simple java codings so i
    can understand it

    I know these quenstions may sound stupid but please bear with me

    Thank You

    Yours Sincerely

    Richard West
    freesoft_2000, Nov 1, 2005
    #1
    1. Advertising

  2. freesoft_2000

    VisionSet Guest

    "freesoft_2000" <> wrote in message
    news:...
    >
    > Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a :
    > a.getBounds();
    >
    > Could someone translate the above code into simple java codings so i can
    > understand it


    Rectangle alloc ;
    if (a instanceof Rectangle) alloc = (Rectangle) a;
    else alloc = a.getBounds();

    >
    > And finally what does the below code mean
    >
    > x*= 0.5
    >


    x = x * 0.5;

    --
    Mike W
    VisionSet, Nov 1, 2005
    #2
    1. Advertising

  3. freesoft_2000 wrote:

    > I know these quenstions may sound stupid ..


    Only because they are. But at least that is a start.
    Once you can accurately identify stupid questions,
    it will(/should) help you not ask them.

    > ..but please bear with me


    What motivation is there to give you the patience
    normally reserved for Java noobs, when you fail to
    post questions to the group* best suited for those
    new to Java/usenet/formulating intelligent questions?

    * You should know the group. I have mentioned it to
    you on earlier occasions.
    Andrew Thompson, Nov 1, 2005
    #3
  4. freesoft_2000

    Ted Present Guest

    > * You should know the group. I have mentioned it to
    > you on earlier occasions.


    As another java "noob," could you tell me what group that might be?

    ~~Ted Present
    Ted Present, Nov 1, 2005
    #4
  5. freesoft_2000

    SteveB Guest

    "Ted Present" <> wrote in message
    news:VYP9f.77$Ul3.73@trndny07...
    > > * You should know the group. I have mentioned it to
    > > you on earlier occasions.

    >
    > As another java "noob," could you tell me what group that might be?
    >


    comp.lang.java.help
    SteveB, Nov 1, 2005
    #5
  6. Ted Present wrote:

    >>* You should know the group. I have mentioned it to
    >>you on earlier occasions.

    >
    > As another java "noob," could you tell me what group that might be?


    <http://www.physci.org/codes/javafaq.jsp#cljh>

    There is a description of the major Java usenet groups in
    the PhySci Java FAQ..
    <http://www.physci.org/codes/javafaq.jsp#groups>

    HTH
    Andrew Thompson, Nov 1, 2005
    #6
  7. freesoft_2000

    Ted Present Guest

    Thanks I'll take a look. I've a bit of java experience, but being
    self-taught, there are a few simple things that I often get caught up over.
    This group has helped befire, but much of it was way above me.

    ~~Ted Present

    >> > * You should know the group. I have mentioned it to
    >> > you on earlier occasions.

    >>
    >> As another java "noob," could you tell me what group that might be?
    >>

    >
    > comp.lang.java.help
    >
    >
    Ted Present, Nov 1, 2005
    #7
  8. freesoft_2000

    SteveB Guest

    "Ted Present" <> wrote in message
    news:4lQ9f.177$9E4.9@trndny02...
    > Thanks I'll take a look. I've a bit of java experience, but being
    > self-taught, there are a few simple things that I often get caught up

    over.
    > This group has helped befire, but much of it was way above me.
    >

    I'm in the same boat.
    SteveB, Nov 1, 2005
    #8
  9. freesoft_2000

    Rhino Guest

    "Andrew Thompson" <> wrote in message
    news:tIO9f.6307$...
    > freesoft_2000 wrote:
    >
    > > I know these quenstions may sound stupid ..

    >
    > Only because they are. But at least that is a start.
    > Once you can accurately identify stupid questions,
    > it will(/should) help you not ask them.
    >

    There is nothing "stupid" about his questions. They simply demonstrate his
    inexperience with Java. There's nothing stupid about being new to Java; we
    were all beginners once.

    > > ..but please bear with me

    >
    > What motivation is there to give you the patience
    > normally reserved for Java noobs, when you fail to
    > post questions to the group* best suited for those
    > new to Java/usenet/formulating intelligent questions?
    >
    > * You should know the group. I have mentioned it to
    > you on earlier occasions.


    You appear to have more justification for these remarks. However, I don't
    think of comp.lang.java.help as being reserved for "noobs" or those who are
    new to Java, Usenet or formulating intelligent questions. I don't consider
    myself to fit into any of those categories but I post questions at
    comp.lang.java.help occasionally when I want to discuss concepts or design
    issues when I have gaps in my OO background, for instance. The atmosphere
    seems a bit more patient and tolerant there while comp.lang.java.programmer
    sometimes seems frenzied and rude by comparison.

    _You_ may want to relegate beginners to that newsgroup but I think it is a
    bit presumptious of you to pretend to speak for the entire Java community or
    to be the final authority on what belongs in each newsgroup. At any rate,
    the fact that a number of people besides myself seem to feel the same way
    suggests you do not speak for _us_.

    Mind you, I'm not saying there's anything wrong with a newsgroup
    specifically for beginners. It just doesn't seem to me that there is a
    concensus that comp.lang.java.help is it. It seems to be used for things
    other than what you have in mind.

    Rhino
    Rhino, Nov 1, 2005
    #9
  10. freesoft_2000

    Roedy Green Guest

    On Tue, 01 Nov 2005 13:28:59 -0500, "freesoft_2000"
    <> wrote, quoted or indirectly quoted someone
    who said :

    >Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a :
    >a.getBounds();


    I gather the ternary operator is what has you flummoxed.
    See http://mindprod.com/jgloss/precedence.html#TERNARY

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 1, 2005
    #10
  11. freesoft_2000

    Roedy Green Guest

    On Tue, 01 Nov 2005 13:28:59 -0500, "freesoft_2000"
    <> wrote, quoted or indirectly quoted someone
    who said :

    >x*= 0.5


    These are very basic questions handled by any introductory text. Get
    hold of a Java text, even an out of date, second hand one will cover
    all this sort of thing. You will drive everyone nuts asking these
    hundreds of bits of trivia you need one at a time.

    see http://mindprod.com/jgloss/gettingstarted.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 1, 2005
    #11
  12. freesoft_2000

    zero Guest

    "Ted Present" <> wrote in
    news:4lQ9f.177$9E4.9@trndny02:

    > Thanks I'll take a look. I've a bit of java experience, but being
    > self-taught, there are a few simple things that I often get caught up
    > over. This group has helped befire, but much of it was way above me.
    >


    This is a programmer-to-programmer group, although a lot of newbies do come
    here for questions. If things here go above your head don't get
    discouraged. Other groups (like clj.help) might answer in more
    understandable terms, but you'll learn more by asking questions there and
    lurking here. After a while, things will start to make sense.

    And btw most people here don't understand everything either. Everyone has
    their speciality, and everyone encounters threads they can't contribute in,
    for whatever reason.
    zero, Nov 1, 2005
    #12
  13. freesoft_2000

    Roedy Green Guest

    On Tue, 1 Nov 2005 16:53:17 -0500, "Rhino"
    <> wrote, quoted or indirectly
    quoted someone who said :

    >There is nothing "stupid" about his questions. They simply demonstrate his
    >inexperience with Java. There's nothing stupid about being new to Java; we
    >were all beginners once.


    The questions are not stupid questions per se. We all had them at one
    point, even if it was back in the C days wondering what that strange
    notation meant.

    They are stupidly inefficient in that they are so basic and so widely
    answered in textbooks, that they really should not be asked in an
    intermediate newsgroup. Further, they are not particularly mysterious
    once explained. It is not as though most people would need any
    auxiliary explanation.

    It is a bit like an adult asking strangers to spoon feed him his
    breakies.

    For people with English as a second language, I am more patient. I
    don't presume they have access to texts in their own language or that
    they can understand the English language explanations. Text book
    authors often have a rather unusual way of speaking.

    On the other hand, if a low IQ person is determined to learn Java, I
    say more power to him. If that person genuinely does not understand,
    and has made some effort to understand, I am willing to take time to
    explain and explain no matter how much I think the issue SHOULD be
    obvious.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 1, 2005
    #13
  14. freesoft_2000

    Roedy Green Guest

    On Tue, 1 Nov 2005 16:53:17 -0500, "Rhino"
    <> wrote, quoted or indirectly
    quoted someone who said :

    >_You_ may want to relegate beginners to that newsgroup but I think it is a
    >bit presumptious of you to pretend to speak for the entire Java community or
    >to be the final authority on what belongs in each newsgroup.


    I think there are official charters. There are various descriptions
    of the consensus of what the groups are for in various FAQs.

    There are people who subscribe to only comp.lang.java. programmer.
    They are busy people. They want to stay abreast of what's happening,
    but have only a little time to do it. Threads about what *= means are
    a total waste of their valuable time.

    To them, newbies who is insist on posting to comp.lang.java.programmer
    are much like those 90 year old Sunday drivers on the freeway.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 1, 2005
    #14
  15. freesoft_2000

    zero Guest

    Roedy Green <> wrote in
    news::

    >
    > For people with English as a second language, I am more patient. I
    > don't presume they have access to texts in their own language or that
    > they can understand the English language explanations. Text book
    > authors often have a rather unusual way of speaking.
    >


    True.

    However, being a non-native English speaker, I have found that translations
    are usually worse. Either they are translated by people who know both
    languages, but nothing about computers, or by computer-savvy people who
    don't have a real translator's skills.
    I always found it better to read the original English texts, and IMO
    knowledge of English is imperative in computer science.

    That being said, I do understand that languages and computers are very
    distinct, and not everyone has a grasp on both. I think it's good that
    people whose English is less than perfect find their way to usenet and try
    their best to explain their problem, and I do try to help.
    zero, Nov 1, 2005
    #15
  16. freesoft_2000

    Ted Present Guest

    Re: "What does this mean??" post's validity

    "zero" <> wrote in message
    news:Xns97024E07BF5Czerothishi@195.130.132.70...
    > That being said, I do understand that languages and computers are very
    > distinct, and not everyone has a grasp on both. I think it's good that
    > people whose English is less than perfect find their way to Usenet and try
    > their best to explain their problem, and I do try to help.


    I agree. Despite (obviously, as from my earlier posts) being new to this
    newsgroup, I've used Usenet for some time and web forums for even longer.
    Although people who make honest grammatical/spelling mistakes shouldn't be
    shunned (I've done it myself; "teh" instead of "the"), I think that people
    who don't care enough to even try writing clearly are the same people who
    don't care enough to try working out their own problems.

    Posts that look like...
    hey can some1 help me i cant get [put problem here] to wrok cause it doesnt
    open rite
    ....probably aren't worth too much time.

    However, if the content is still useful to a given community and it can be
    deciphered, I've got to hand it to those who take the time to work out an
    answer. Maybe posters will learn to write clearer, more relevant posts.

    Of course, this thread might have evolved to be a bit OT for this newsgroup
    :)

    --
    Ted Present
    Ted Present, Nov 1, 2005
    #16
  17. freesoft_2000

    Dave Glasser Guest

    Roedy Green <> wrote on
    Tue, 01 Nov 2005 23:20:30 GMT in comp.lang.java.programmer:

    >On Tue, 1 Nov 2005 16:53:17 -0500, "Rhino"
    ><> wrote, quoted or indirectly
    >quoted someone who said :
    >
    >>_You_ may want to relegate beginners to that newsgroup but I think it is a
    >>bit presumptious of you to pretend to speak for the entire Java community or
    >>to be the final authority on what belongs in each newsgroup.

    >
    >I think there are official charters. There are various descriptions
    >of the consensus of what the groups are for in various FAQs.
    >
    >There are people who subscribe to only comp.lang.java. programmer.
    >They are busy people. They want to stay abreast of what's happening,
    >but have only a little time to do it. Threads about what *= means are
    >a total waste of their valuable time.
    >
    >To them, newbies who is insist on posting to comp.lang.java.programmer
    >are much like those 90 year old Sunday drivers on the freeway.


    I disagree. The aforementioned driver can block the passing lane and
    force me to drive slower than I normally would, wasting my time, and
    causing me enormous frustration. OTOH, the newbie posting to cljp
    wastes virtually none of my time. I can tell within a few seconds
    whether or not a post is worth bothering with. If not, I simply ignore
    it. No harm no foul.


    --
    Check out QueryForm, a free, open source, Java/Swing-based
    front end for relational databases.

    http://qform.sourceforge.net

    If you're a musician, check out RPitch Relative Pitch
    Ear Training Software.

    http://rpitch.sourceforge.net
    Dave Glasser, Nov 2, 2005
    #17
  18. freesoft_2000

    Roedy Green Guest

    On Tue, 01 Nov 2005 23:28:46 GMT, zero <> wrote, quoted or
    indirectly quoted someone who said :

    >However, being a non-native English speaker


    I would not have guessed. You don't have an "accent". I don't
    recognise .hi as a country code.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 2, 2005
    #18
  19. freesoft_2000

    Roedy Green Guest

    On Tue, 01 Nov 2005 19:14:04 -0500, Dave Glasser <>
    wrote, quoted or indirectly quoted someone who said :

    >I disagree. The aforementioned driver can block the passing lane and
    >force me to drive slower than I normally would, wasting my time, and
    >causing me enormous frustration. OTOH, the newbie posting to cljp
    >wastes virtually none of my time. I can tell within a few seconds
    >whether or not a post is worth bothering with. If not, I simply ignore
    >it. No harm no foul.


    Just as people have different reactions to Sunday drivers so do they
    to misplaced posts.

    There is an advantage to the poster to put it in the proper place
    with a distinctive subject line.

    If someone later thinks of a solution to the problem, they will find
    the thread more easily if it in the right place. If they can't easily
    find it, they may give up, and OP will never hear the solution.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 2, 2005
    #19
  20. Hi everyone,

    >Only because they are. But at least that is a >start.
    >Once you can accurately identify stupid >questions,
    >it will(/should) help you not ask them


    I mean seriously andrew everyone has had their share of stupid questions
    but i asked that question because i have not done programming for some
    time and got rusty.

    >You should know the group. I have mentioned it >to you on earlier

    occasions.

    Actually i don't think you did andrew. You told me not to cross post to
    other forums(which i did not) but you did not mention to me anything about
    this as far as i know

    I am trying to get back into programming after many years and i have
    gotten abit rusty and hope that you guys won't take my questions as
    wasting your time as i have no such intention

    Richard West
    freesoft_2000, Nov 2, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pratip Mukherjee

    Help: what does this VHDL code mean?

    Pratip Mukherjee, Jun 22, 2005, in forum: VHDL
    Replies:
    16
    Views:
    1,270
    Kim Enkovaara
    Jun 27, 2005
  2. methi
    Replies:
    1
    Views:
    836
    info_
    Jun 23, 2005
  3. Li Ma
    Replies:
    1
    Views:
    2,272
    Roedy Green
    Mar 9, 2009
  4. Rahul
    Replies:
    4
    Views:
    559
    Robert Kern
    Apr 7, 2009
  5. C Barrington-Leigh
    Replies:
    1
    Views:
    1,193
    Tim Leslie
    Sep 10, 2010
Loading...

Share This Page