• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

bitwise operations - why on certifcation test??

 
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm preparing fot SCJP 1.4 ... Can anyone tell me why questions about bitwise operations and bit shifing are on the certification test???

I can understand why its included in the language ... but it seems a waste of my time mental energy to prepare this stuff ... and I'm thinking may be unwise and perhaps unsafe (read error prone) ... to try bit arithmatic on integers in my apps ... and ... Can anyone honestly tell me that they have used this in a real application?? Why?
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm preparing fot SCJP 1.4 ... Can anyone tell me why questions about bitwise operations and bit shifing are on the certification test???

There's certainly more useful stuff to learn about! Questions on bitwise operations were dropped for SCJP 5; have you considered taking that exam instead?

You might need bitwise operators in a few specific application areas, typically more low-level stuff, but they're not particularly useful in general programming. Sometimes they're used for certain parts of the Java API, where constants are bitwise-OR'd together, e.g. http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Modifier.html
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why, is a difficult question to answer. It requires a justification which certainly can be challenged. Why, is a dangerous question.

There is not much to bitwise operations. Why not just learn what they want. You move the bits left or right and add zeros or duplicate the sign aleady there. Thats about it. leftmost bit is sign bit. Throw away bit that gets pushed off. add zeros for unsigned shift. use same sign for signed shift.

Then there is XOR ^ that if one or the other is true then the result is true but if both are true or both false then it is false.

Then there is ~ which is negate. if it is false then make it true and if true make it false.

And there is and/or but I won't even mention those.

JAVA is a full language as they say, not a small toy language for demo purposes.

Just because you do not use a particular language feature does not mean no one does. It does not mean we should throw it out either. Programmers doing commnications may need some of these features as well as those doing numerical methods programs, mathematical based calculations, character manipulations and many more. The term scientific programming comes to mind.

Also understanding the bits n bytes of things makes for a better understanding of what goes on. If you work with unicode you will need some of these operations.

So my answer would be requiring some knowledge of bits makes for better understanding and also many jobs will require it.

You will need to ask the real guys why they put it in. I am just guessing.

Stop and study.
 
Keith Flo
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the replies!
 
Keith Flo
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will take a look at the 1.5 test instead.
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it is reasonable to ask why it is on the SCJP 1.4 exam, as it is supposed to be an introductory exam. The fact that they dropped it from the 1.5 exam indicates that perhaps it is not appropriate for an introductory exam.
 
I was her plaything! And so was this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic