fork download
  1. Set<String> uniqueFruits = new Set<String>();
  2. uniqueFruits.add('Apple');
  3. uniqueFruits.add('Banana');
  4. uniqueFruits.add('Apple'); // Duplicate, will not be added
  5. System.debug(uniqueFruits.contains('Banana')); // Output: true
Success #stdin #stdout #stderr 0.01s 7868KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog:1: expected expression