This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table 7-7, page 594

 
Kitty Liem
Greenhorn
Posts: 2
Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The add(index, element) method for List returns nothing but table tells me boolean...
 
Chan Ag
Rancher
Posts: 1089
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

This tells me the return type of the method is void. Where does it say the method is supposed to return a boolean?

Which book/source has the table/code in question?

Consider reading QuoteYourSources.

Chan.
 
Siddharth Raja
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are referring to K & B

yes, boolean add(index, element) is a mistake

its void add(index, element) ...this versio of add method is defined in the List interface only
my source (Herbert Schildt - the complete reference for Java 7th Edition)
 
Kitty Liem
Greenhorn
Posts: 2
Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, should be in Compiling errata K&B topic...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic