Set<String> Accountids = new Set<String>(); for (Account a: [Select Id from Account limit 5]) Accountids.add(a.Id); system.debug('The size of the set is'+accountids.size()); for (Account a: [Select Id from Account limit 5]) Accountids.add(a.Id); system.debug('The size of the set is'+accountids.size());
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter