how to push an element in hashset java

Java
HashSet<Integer> set=new HashSet<>();
//adding a new element
set.add(10);
Source

Also in Java: