Java Challenge (2)

Here I am again!! The most of java programmers have in mind the knowledge about reference variables, so it's easy for them to tell the console output of the code below: import java.awt.Dimension; public class Test {               public static void main(String[] args) {                           Dimension d1 = new Dimension(100, 50);                           Dimension d2 = d1; … Continue reading Java Challenge (2)

Java Challenge Answer

Yes Ademir, you're completly right. In Java, all classes extends Object, and every class, before execute its constructor's code, makes a call to its superclass through the 'super()' assignment. So, if you don't call 'super()' inside the subclass's constructor, the compiler will do it for you implicitly, but it will always decide by using the … Continue reading Java Challenge Answer