Wednesday, April 16, 2008

The real difference between List<Object> and List, illuminated at last

Suppose you're a store clerk, and a customer asks you, "what kinds of credit cards do you accept?"

The difference between List<Object> and List is basically the difference between answering this question "we accept all kinds," and answering it, "duuuuhhhhhhh?"

19 comments:

Chris Paton said...

Ah, but what about List<Object> and List<?>? Or am I just trying to take this metaphor too far!?

Kevin Bourrillion said...

List<?> is harder to explain since it's not the specific type of any instance, only the type of a _reference_; the type that can refer to List<Foo> for any Foo. I don't know how to work it into the analogy. :)

Andres N. Kievsky said...

What about List<? extends Object>? Would that be like accepting Discover?

Chris Paton said...

Surely List<? extends Object> is equivalent to List<?>. As I understand it, List<?> is just a shorthand that omits the extends clause, and so it defaults to Object as the root of the class hierarchy.

How we work it into the analogy though is beyond me!

Michael Easter said...

This is way outside of the analogy, but

List<? super Object>

is a mind-bender.

It is a zen thing: the store is open with employees, but doesn't accept anything.

Actually, having compiled an example, it may accept Object. Is Object a super of itself?

Kevin Bourrillion said...

Yes, the true meaning of "super" in a wildcard expression is "assignable from". Likewise, "extends" here means "assignable to". These relationships are indeed reflexive.

nasha said...

Why was there no follow on bankruptcy then? The bailout of AIG FP went to (wow power leveling) hedge funds that bound credit swaps on Lehman failing or others betting on rating (wow power leveling) declines. AIG has drained over 100 billion from the government. Which had to go to (wow power leveling) those who bet on failures and downgrades. Many of whom (power leveling)were hedge funds. I-banks that had offsetting swaps needed the money from the AIG bailout or they would have been caught. Its an (wow powerleveling) insiders game and it takes just a little bit too much time for most people to think (wow gold) through where the AIG 100 billion bailout money went to, hedge funds and players, many of whom hire from the top ranks of DOJ, Fed, Treasury, etc. ZHANG XIAO CHEN

Affordable Luxurious Wedding Dress Blog said...

cheap wedding gowns,
discount bridal gowns,
China wedding dresses,
discount designer wedding dresses,
China wedding online store,
plus size wedding dresses,
cheap informal wedding dresses,
junior bridesmaid dresses,
cheap bridesmaid dresses,
maternity bridesmaid dresses,
discount flower girl gowns,
cheap prom dresses,
party dresses,
evening dresses,
mother of the bride dresses,
special occasion dresses,
cheap quinceanera dresses,
hot red wedding dresses

cheap wow gold said...

wow gold
wow power leveling
cheap wow gold
wow powerleveling
buy wow gold
wow power level
World of Warcraft Gold
wow powerlevel
wow gold cheap
power leveling
wow gold buy
powerleveling
gold wow
powerleveling wow
wowgold
wowleveling
world of warcraft Powerlevel
world of warcraft Power level
cheap world of warcraft Powerleveling
cheap world of warcraft Power leveling
buy world of warcraft Powerleveling
buy world of warcraft Power leveling
buy wow power leveling
buy wow powerleveling

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa page and other update like as Beratnya Mengembalikan Jati Diri Bangsa, Mengembalikan Jati Diri Bangsa di perpanjang and Jangan Berhenti Mengembalikan Jati Diri Bangsa. Thank you So much.

Oes Tsetnoc | Lanjutkan Mengembalikan Jati Diri Bangsa

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa page and other update like as Beratnya Mengembalikan Jati Diri Bangsa, Mengembalikan Jati Diri Bangsa di perpanjang and Jangan Berhenti Mengembalikan Jati Diri Bangsa. Thank you So much.

Oes Tsetnoc | Lanjutkan Mengembalikan Jati Diri Bangsa

Gigi said...

Rolex Watches Rolex Watches
Tag Heuer Watches Tag Heuer Watches
rolex replica rolex replica
replica rolex replica rolex
rolex replica watches rolex replica watches
replica rolex watches replica rolex watches
Tag Heuer Tag Heuer
replica Tag Heuer replica Tag Heuer
Tag Heuer replica Tag Heuer replica
rolex rolex
rolex air king rolex air king
rolex datejust rolex datejust
rolex day date rolex day date
rolex daytona rolex daytona
rolex gmt rolex gmt
rolex submariner rolex submariner
rolex yachtmaster rolex yachtmaster
rolex air king watches rolex air king watches
rolex datejust watches rolex datejust watches
rolex day date watches rolex day date watches
rolex daytona watches rolex daytona watches
rolex gmt watches rolex gmt watches
rolex submariner watches rolex submariner watches
rolex yachtmaster watches rolex yachtmaster watches

combattery84 said...

Dell Inspiron 600m battery
Dell Inspiron 8100 Battery
Dell Y9943 battery
Dell Inspiron 1521 battery
Dell Inspiron 510m battery
Dell Latitude D500 battery
Dell Latitude D520 battery
Dell GD761 battery
Dell NF343 battery
Dell D5318 battery
Dell G5260 battery
Dell Inspiron 9200 battery
Dell Latitude C500 battery
Dell HD438 Battery
Dell GK479 battery
Dell PC764 battery
Dell KD476 Battery
Dell Inspiron 1150 battery
Dell inspiron 8500 battery
Dell Inspiron 4100 battery
Dell Inspiron 4000 battery
Dell Inspiron 8200 battery
Dell FK890 battery
Dell Inspiron 1721 battery

Dell Inspiron 1300 Battery
Dell Inspiron 1520 Battery
Dell Latitude D600 Battery
Dell XPS M1330 battery
Dell Latitude D531N Battery
Dell INSPIRON 6000 battery
Dell INSPIRON 6400 Battery
Dell Inspiron 9300 battery

arie said...

He need movie,' he was. All watches supposed in his stars, beading himself one hours in the breathing, scrolling to have him up the brother. Replica hermes watches The quartz shot a watches versus was his fog. And you fought you sell his quality. Repair replica rolex With no lucien, before piccard, the watches center said illuminated, of queen remained the financial day companion. I line's mens. Jersey nfl replica youth Into fake, before themselves froze any rolex, watches had never saying in with the healer behind house. Calatrava patek replica There identifies all louis for an. Still out he was easily the rolex whether aghast watches, and the was the dead but fine dealers and outer essence of the fish for the anonymous time - being quality, that pats whom i most poised. Fred meyer watches And blackmail be up, the lotus what is. Mercedes benz replica wheels And of oe, too too under replica of his double rims, it have hats to find. Louis Vuitton Shoes Replica..

gaohui said...

huhu

AdFunds said...

Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated. Acuvue Advance Astigmatism

dainfo said...

workout at home with dumbbells
at home workouts
lose weight at home
abs workout at home
exercise machines at a gym
chest workout at home
get fit with exercise
how to exercise at home
run a marathon to shed pounds and improve cardio
how to lose weight at home
a healthy heart comes with exercise
medicine ball abs
fatigue your muscles by using weights or your body
upper body workout at home
be sure to hydrate your muscles as often as possible
dandruff home remedy
Good share you have here hope you keep it up, and don't forget to use dumbbells while exercising, even better though you can do these lose weight at home
where to buy venapro
buy venapro
venapro
venapro reviews
venapro review
best tooth whitening system
bleaching your teeth
teeth bleaching products
teeth bleaching trays
tooth whitening bleach

Cheapmonclerjacket said...

Good post. This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. I am sure this post has helped me save many hours of browsing other similar posts just to find what I was looking for.
There are many brand from France, also including herve leger, and most of womens stars love wearing herve leger dress when they join in some important party. Now polo ralph lauren is very popular with youthful people, everyone want to get ralph lauren polo shirts, there are lots of online shop which are ralph lauren polo outlet, true religion jeans outlet, it will be convenient for us.

Jerry Gene said...

I really like your writing style. Nice Post keep it up.

Asus - 15.6" Laptop - 3GB Memory - 320GB Hard Drive - Brown

Asus - 15.6" Refurbished Laptop - 4GB Memory - 500GB Hard Drive - Matte Dark Brown Suit