Currently Browsing: standard java

backToBasics: Same VM, everything in Java is pass by value

Let's refresh the topic for all the variables running in a single virtual machine "Everything in Java is pass by value", Some newcomers may think, in java pass by value only for primitives, and pass by reference for objects, Method declaration could take primitive, object reference arguments or both. When we pass the object variable into a method, then we pass the copy of the object reference of that variable to the method not the actual object. We will understand this with following bitterSwap method. Classic swap function explanation, the following method is suppose to swap the arguments...
read more

backToBasics : Java BitWise Shift operators

Have you designed a bitboard? Yes..Skip the reading..:) Guys I am happy to start "backToBasics series" for java and related technologies. The bitwise operators mostly used for setting individual flag bits in value, prerequisite for following explanation is binary numbers and 2's complement representation. The bitwise shift operators are : >> , << , >>> Operands of byte, char, or short type are implicitly upcast to int before the operation. Bitwise shift operators are applicable only to int and long, we can not use with floating point, boolean, array or any java object. If...
read more