I am trying to create a class using the following code but getting error: " Incompatible element type String for collection of listex.s "
Page:
<apex:page controller="listex">
<apex:pageBlock >
<apex:pageBlockTable value="{!list}" var="a">
<apex:column value="{!a.numb}"/>
<apex:column value="{!a.str}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Controller:
public class listex {
public list<s> inte;
public integer numb;
public string str;
public list<s> getlist(){
list<s> inte = new list<s>();
for(integer i=0;i<3;i++) {
inte.add(numb=i,str='name'+i);
return inte;
}
}
public class s{
public integer numb;
public string str;
public s(integer i, string s){
this.numb = i;
this.str = s;
}
}
}