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.
Posted by Dmitriy Ugnichenko on Tuesday, September 4, 2012 / Labels: python
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.
Posted by Dmitriy Ugnichenko / Labels: 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:
Posted by Dmitriy Ugnichenko / Labels: 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:
Posted by Dmitriy Ugnichenko /
Ok, so it's known, that object wrappers (e.g. Integer, Double etc.) are immutable. But what does it really mean?