• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange behavior with List and Object[]  RSS feed

 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I recently build the Java EE 5 Tutorial's coffeebreak application from command line and deloyed it to Sun's Glassfish V2 application server. So far so good.

Then I created the coffeebreak modules again, this time in Eclipse. Everything is fine, except one thing that makes me wonder. There is one line in code where it says:

List<PriceItemBean> priceItems = priceList.getPriceItems();

and

public PriceItemBean[] getPriceItems() {return priceItems;}

In Eclipse I get an error: Type mismatch: cannot convert from PriceItemBean[] to List<PriceItemBean>

How could that example run in the first place

P.S.: The example are from RetailPriceList.java and PriceListBean.java of the Java EE 5 Tutorial
[ September 27, 2007: Message edited by: Darya Akbari ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!