Search results
"category:/java/brainteaser"
| Title and summary | Date/time | |
|---|---|---|
|
1 |
Brainteaser Drools: Testing Objects
This can be a hard one, since it requires from you to be familiar with Drools. Consider the condition side of the following rules: rule "object comparison one"no-loop when $customer1 : Customer( ) $customer2 : Customer(this != $customer1) then ... |
22/08/2009 10:50:00 PM |
|
2 |
Brainteaser: Overridable methods
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); ... |
18/04/2009 12:02:00 PM |
|
3 |
Brainteaser: Broken case of inheritance
Consider the following case of inheritance: public class ExtendingHashSetE extends HashSetE { private int counter = 0; public ExtendingHashSet() { } @Override public boolean add(E e) { counter++; return super.add(e); } ... |
05/04/2009 8:34:00 PM |
|
4 |
Brainteaser: Broken comparator
Question: The following program returns result "1", which indicates that first Integer value is greater than the second, why? import java.util.*;public class Example { public static void main(String[] args) { ... |
19/10/2008 1:25:00 AM |
|
5 |
Brainteaser: ArrayList VS TreeSet
When I came across the following example I did not expect the results that the program has printed :) hehe... Question: What does this program print? Why? import java.util.*;public class SetList { public static void main(String[] args) { ... |
01/10/2008 1:31:00 PM |
|
6 |
Brainteaser: Hidden iterators
... While locking can prevent iterators from throwing ConcurrentMofdificat... |
07/09/2008 6:05:00 PM |




