Basic doubts in operators

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sindhu sweet
    New Member
    • Aug 2007
    • 18

    Basic doubts in operators

    Hi friends,

    can anyone tell me..
    1)what happens in the statement

    int a=16,a>>2=4
    what does the >>(right shift operator)do?

    2)what will be the result of the expression 13&25?
    what does the & operator do in this expression?


    thankx in advance
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by sindhu sweet
    Hi friends,

    can anyone tell me..
    1)what happens in the statement

    int a=16,a>>2=4
    what does the >>(right shift operator)do?

    2)what will be the result of the expression 13&25?
    what does the & operator do in this expression?


    thankx in advance
    You're studying Java right? I assume you've got a book for that, right? How come
    that book doesn't cover Java's operators? Is that book that bad? Shame on your
    teacher then for handing out such crap.

    kind regards,

    Jos

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by sindhu sweet
      Hi friends,

      can anyone tell me..
      1)what happens in the statement

      int a=16,a>>2=4
      what does the >>(right shift operator)do?

      2)what will be the result of the expression 13&25?
      what does the & operator do in this expression?


      thankx in advance
      The Sun tutorial entry for those things is here.
      Read it and post again if you're still confused.

      Comment

      • sindhu sweet
        New Member
        • Aug 2007
        • 18

        #4
        Originally posted by JosAH
        You're studying Java right? I assume you've got a book for that, right? How come
        that book doesn't cover Java's operators? Is that book that bad? Shame on your
        teacher then for handing out such crap.

        kind regards,

        Jos

        ya...am reading java....and reading it on my own....
        i am new to java...thats why...silly doubts...
        if its so silly..pardon me for posting such crap....

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by sindhu sweet
          ya...am reading java....and reading it on my own....
          i am new to java...thats why...silly doubts...
          if its so silly..pardon me for posting such crap....
          He didn't say you posted crap. He said a Java book without those things is crap.

          Comment

          • sindhu sweet
            New Member
            • Aug 2007
            • 18

            #6
            Originally posted by r035198x
            The Sun tutorial entry for those things is here.
            Read it and post again if you're still confused.

            thanks a lot friend....it was quite informative...

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #7
              Originally posted by sindhu sweet
              ya...am reading java....and reading it on my own....
              i am new to java...thats why...silly doubts...
              if its so silly..pardon me for posting such crap....
              Well, the question by itself isn't crap; it is just very easily answered if you first
              did some reading; that's what books are for.

              kind regards,

              Jos

              Comment

              • sindhu sweet
                New Member
                • Aug 2007
                • 18

                #8
                Originally posted by r035198x
                He didn't say you posted crap. He said a Java book without those things is crap.
                oh sorry yaar..i misunderstood.. .


                thanks once again for ur post...

                Comment

                Working...