Java Inheritance: Method set(List) not applicable for arguments ArrayList -


I am getting an error in the following.

Hierarchy: General Budget - -> RRBTB

These figures include the following hierarchy: General Budget ArrayBan - & gt; RRBudgetYearBean

Parent Category - GeneralBudgetBean.java

  // Data from a member list & lt; GeneralBudgetYearBean & gt; BudgetYearBeans; // gates / satars public list & lieutenant; GeneralBacketYireBan & gt; GetBudgetYearBeans () {return budget YEARBeans; } Public Zero SetBizTirebusiness (List & Lieutenant; GeneralBacketWirebans> Budget Yearbains) {this.budgetYearBeans = budgetYearBeans; }  

Extension class - RRBudgetBean.java

  Public category RRBudgetBean extends GeneralBudgetBean {// ... public zero initRRBudgetBean ( ) {this.setBudgetYearBeans (New Arlist & lt; RRBudgetYearBean & gt; ()); }}   

Error:

  GeneralBudgetBean argument in type setBudgetYearBeans (list of GeneralBudgetYearBean & gt;) ArrayList & lt is not applicable; RRBudgetYearBean & gt; In other words, the error is:  
  Method method (the list of the & lt; bean & gt;) argument ArrayList & lt is not applicable; SubBean & gt;    

from the tutorial (): box & lt; Integer & gt; and from the box & lt; Double & gt; is not box & lt subtype; Number & gt;

In that case, you must change the method signing to

  public zero setBudgetYearBeans (list?) GeneralBudgetYearBean & gt; Expands budgetYearBeans ) {This.budgetYearBeans = budgetYearBeans; }   

That article may be useful about wildcards.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -