fork download
  1. List<String> ob=new List<String>();
  2. List<SelectOption> paginationOptions=new List<SelectOption>();
  3. ob.add('a');
  4. SelectOption preselected;
  5. for(String ac: ob){
  6.  
  7. if('2' == '2'){
  8. paginationOptions.add(new SelectOption('lakhn','lakhn'));
  9. }
  10. if('1' == '1'){
  11. preselected= new SelectOption('ram', 'ram');
  12. paginationOptions.add(preselected);
  13. }
  14.  
  15. }
  16. if(paginationOptions.size() > 0){
  17. paginationOptions.set(0,preselected);
  18. }
  19. System.debug('pagination'+paginationOptions);
Success #stdin #stdout #stderr 0.01s 7744KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog:1: expected expression