Click here to watch in Youtube :
https://www.youtube.com/watch?v=-EyafDqufFM&list=UUhwKlOVR041tngjerWxVccw
HashSetExample.java
Output
https://www.youtube.com/watch?v=-EyafDqufFM&list=UUhwKlOVR041tngjerWxVccw
HashSetExample.java
import java.util.HashSet; /* * Example of remove(Object o) method. */ public class HashSetExample { public static void main( String[] args ) { HashSet<String> hashSet = new HashSet<String>(); hashSet.add("Dave"); hashSet.add("Peter"); hashSet.add("Phil"); hashSet.add("Rohit"); hashSet.add("Virat"); System.out.println("hashSet : " + hashSet + "\n"); /* * Removes the specified element from this set if it is present. */ boolean isRemoved = hashSet.remove("Virat"); System.out.println("isRemoved : " + isRemoved); System.out.println("hashSet : " + hashSet + "\n"); } }
hashSet : [Rohit, Dave, Phil, Peter, Virat] isRemoved : true hashSet : [Rohit, Dave, Phil, Peter]
https://sites.google.com/site/javaee4321/java-collections/HashSetDemoRemove.zip?attredirects=0&d=1
See also:
We are added much functionality in this Remove object from photo and Remove BG from photo app like remover, clone stamp, background eraser, quick remover, transparent background and cloth remover.
ReplyDeleteNice information thanks for share. you should read about this cloth remover app
ReplyDelete