How to design Money Class in Java ?

In this post we will talk and learn How to design Money Class in Java  ?  Money is basically composed of two fundamental entities Amount and Currency. The BigDecimal is ideal data type provided in Java language for representing monetary values and Java also provides Currency Class implementation. Money class

Note: The code shown above… Read More »

How would you check if a number is even or odd using bit wise operator in Java?

In this post we will talk and learn How would you check if a number is even or odd using bit wise operator in Java? using an example. If you look carefully for all Odd numbers rightmost bit is always 1 in binary representation.

Notes We should prefer Bitwise operator for checking even or odd… Read More »