Java Quiz 15: Improve Encapsulation of Your Code

Before we start with this week's puzzle, here is the answer to Java Quiz 14: Overloading Methods.

The method writeValue(1, 2) invokes writeValue(int, int) because 1 and 2 are integers.The method writeValue(int, int) doesn't exist. Therefore, writeValue(int, double)is invoked instead of writeValue(int, Integer). The reason is that widening is preferred over boxing/unboxing. The correct answer is: D.

What feeling does this article give you?
Joy
Disgust
Fear
Anger
Sadness

#hashtags to follow:

Java Quiz 14 [+]    Overloading Methods [+]    Integer [+]   

More #news: