Category Archives: Java

Java: Inner Classes

Since Java 1.1, when inner classes were first introduced, they have started a lot of discussion. Some people like them and find them useful. Others hate them. Viewpoints apart, the fact is that inner classes can be efficient in many situations … Continue reading

Posted in Java | Tagged , | 1 Comment

Java: Generic Types

Before Java 5, it was not possible to tell to a collection (like a List, a Map or a Set) only to accept objects of a certain type. This kind of collection can hold anything that is not a primitive … Continue reading

Posted in Java | Tagged , | Leave a comment

Java: Operators

As in mathematics, operators in Java are used to produce new values from operands. Choosing the right operator on the right time will help you to write clear code in a fast way. Following a quick review of Java operators. Examples … Continue reading

Posted in Java | Tagged , | Leave a comment

Java: Garbage Collector

Garbage collection are one of the big advantages of Java. Many languages like C and C++ do not offer an automatic mechanism to perform memory management. Manually releasing every object which is not used anymore could become a fastidious and really difficult … Continue reading

Posted in Java | Tagged , | Leave a comment

Java: Passing Variables into Methods

Java use pass-by-value semantics, instead of pass-by-reference, when passing variables to methods. This means that Java copies the variable values used by the caller to pass them to the method. If the variable has a primitive type, the value of the … Continue reading

Posted in Java | Tagged , , , | Leave a comment