RosettaCodeData/Task/Collections/Apex/collections-5.apex

5 lines
275 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
Set<Integer> s = new Set<Integer>(); // Define a new set
s.add(1); // Add an element to the set
System.assert(s.contains(1)); // Assert that the set contains an element
s.remove(1); // Remove the element from the set