Can anyone explain to me what just happened here ?
Roughly speaking, you converted an address 64 bit virtual address to a virtual page number and an offset, using the right-shift operator (>>) and the bitwise AND operator (&).
And what to shall I do to write such a program but in Java as long as I have no background in C language?
What you should do is to read your Java textbook or lecture notes to find out about the >> and & operators (for integer operands), and what they do. Then write the equivalent code in Java.
HINTS:
- The
>>and bitwise&operators mean pretty much the same thing in C and Java. - You should probably also read the lecture notes where your lecturer explained about virtual addresses and how they work.
solved explain what happened (C program) [closed]