Program to Demonstrate usage of set in Apex
write an apex class to demonstrate setpublic class set example
{
Public set<string> names {get; set;}
Public example ()
{
names = new set <string> ();
names. add (‘one’);
names. add (‘two’);
names. add (‘sam’);
names. add (‘one’);
names. add(‘one’);
}
}
Visual force page:
<apex: page controllers = “set Example”>
<apex: page block>
<apex: page block table value = “{! Names}” var = ‘a’>
<apex: column value = “{! a}”/>
</apex: page block table>
</apex: page block>
</apex: page>
No comments:
Post a Comment