• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

great help needed !!

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello every1,
I didn't find sufficient information in K & B to answer this question. I would appreciate if you ranchers would provide me with some links on topics required to answer these kind of conversions/questions.
Any help is appreciated !!!
~ Shalini

class EBH025 {
public static void main (String args[]) {
int i1 = 0xffffffff, i2 = i1 << 33;
int i3 = i1 << (33 & 0x1f);
System.out.print(Integer.toHexString(i2) + ",");
System.out.print(Integer.toHexString(i3));
}}
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what's your question?
 
Ashok Paulraj
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need some links on hex/oct/binary representations of numbers and the operations that can be carried out on them. Also, how to interpret UNICODE numbers into their respective integer formats.
I just blink on questions where some conversions are required from UNICODE to integer representation.
~ Shalini
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Taurean,
Even I was not comfortable, when i encountered such problems.These are the things you can do.
1. Go to Dan's website/marcus website(one of these has info about base conversions).
2. You can make a search for shiftoperators in this forum and i am sure you would get a lot of info
3. You can go to google.com and search on hexadecimal converison.
-sanjana
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Taurean -
did you check out the reply on this thread?
https://coderanch.com/t/244419/java-programmer-SCJP/certification/octal-hex-binary-unicode
If so, what's next? What part of these topics is clear to you, and where do you start getting confused?
Bert
[ January 19, 2004: Message edited by: Bert Bates ]
 
Ashok Paulraj
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bert & others,
I could understand the logic of shift operators and the 2's complement. But what I find difficult is,
1) working on long nos. w.r.t shifts in some of the mock exams
2) frequent conversions that u need to make to get the working a little simple than expected.
In the below question, it requires to have conversion to hexadecimal and work out in a different manner. Does SCJP1.4 exam test our knowledge on shift operators with simple/medium level questions or difficult ones requiring good knowledge on conversions and experience working with long representations too !!!......
for eg::
class EBH021 {
public static void main(String[] args) {
System.out.print((-1 & 0x1f) + "," + (8 << -1));
}}
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Taurean,
Shifting by a negative number is NOT covered on the exam, so if you and Dan want to discuss that as a "research project" go for it!
But for all you SCJP candidate readers, you won't have shift things by a negative amount on the exam!
Taurean - is the rest of the question clear?
Bert
reply
    Bookmark Topic Watch Topic
  • New Topic