Consider the following case of inheritance: public class Parent { public Parent() { getValue(); } public void getValue() { } } public class Child extends Parent { private final Integer integer; public Child() { integer = new Integer(888); } @Override public void getValue() { System.out.println(integer); } } Question: What would the following program print, why? [...]
Read Full Post »
Posted by Alexander Zagniotov in: brainteaser, design patterns, java on Apr 18th, 2009 12:02
Online PDF generator now available. This simple but useful online PDF generator tool allows you to generate PDF document online from HTML snippets. The tool uses Flying Saucer library. The PDF is generated with full compression, including meta data in PDF properties. Keep in mind that for successful PDF generation, your HTML markup has to [...]
Read Full Post »
Posted by Alexander Zagniotov in: java, pebble on Apr 11th, 2009 21:17
In one of my previous posts, I described how I implemented a plug in for Pebble blogging software that allows export of blog entries to PDF. Today, I have made modifications to enable plug in to load font files at run time during PDF generation to provide support for additional non-Latin languages. So now, it [...]
Read Full Post »
Posted by Alexander Zagniotov in: java, pebble on Apr 10th, 2009 19:46
Consider the following case of inheritance: public class ExtendingHashSet<E> extends HashSet<E> { private int counter = 0; public ExtendingHashSet() { } @Override public boolean add(E e) { counter++; return super.add(e); } @Override public boolean addAll(Collection<? extends E> c) { counter += c.size(); return super.addAll(c); } public int getCounter() { return counter; } } Created instance: [...]
Read Full Post »
Posted by Alexander Zagniotov in: brainteaser, design patterns on Apr 5th, 2009 20:34
Within last three weeks, two of my friends living in UK called me with the same question: “How bad is recession in IT industry in Australia? I am thinking to migrate“. One guy from Brazil that I know emailed me: “Hey, I am lodging my application for permanent residency in Australia“… Hm… I know world [...]
Read Full Post »
Posted by Alexander Zagniotov in: off topic on Apr 1st, 2009 20:00