Passing primitives by reference in Java

  Some person, that might have long experience with C++ or C (as in my case) in the past, when coming to the world of Java might be stumbled for a sec, when he or she needs to pass primitives to a function by reference (e.g. to be able to change their values). Some small example is under the cut.

`switch` and `continue` cooperation

Really small tip, but (hopefully) is worth saying about it. Your switch operator won't work with continue, but if only your current `switch` operator is within the loop. This means, that first piece of code won't compile, but the last one will.

Variables are not overriden in subclasses in Java

Today we will discuss some aspects of inheritance and methods overriding in Java. The general idea of inheritance in Java can be found here. Here are two pieces of code to show some tricky things for newbies:

How to emulate 'switch' statement in Python

As you may know already, the Python language does not contain conditional statements for making a choice, that depends on the name of some varialbe (better known to C\C++, Java and other C-like programmers as "switch" statements). But there is the way to implement them in Python too. Of course, you always can use if-elif-else statements. But! Python already has as it's core type such a wonderfull type as Dictionary. So, example is below:

Immutability of object wrappers - what the thing really means

Ok, so it's known, that object wrappers (e.g. Integer, Double etc.) are immutable. But what does it really mean?
This is my first post, so...


Hello, world!