why set doesn't allow duplicate value

why set doesn't allow duplicate value

HI Everyone

Any one can help me why set not allowed duplicate value in java.

Please post ur comment, its urgent.

Thanks in advance

View Answers

March 22, 2012 at 7:04 PM

1)Because set internally used Tree hierarchy that follows binary tree algorithm that's why it doesn't allow duplicate value. 2) It uses equals method for all object that we are storing in set.









Related Tutorials/Questions & Answers:
why set doesn't allow duplicate value
why set doesn't allow duplicate value  HI Everyone Any one can help me why set not allowed duplicate value in java. Please post ur comment, its urgent. Thanks in advance
Why doesn't Java allow overriding of static methods?
Why doesn't Java allow overriding of static methods?  Why doesn't Java allow overriding of static methods
Advertisements
javascript duplicate value
javascript duplicate value  In javascript how to find the duplicate or variable that contains same value for example ...two different variables contains the same URL Link.    //To loop through use this $("a:contains
how to set the value of textfield constant
how to set the value of textfield constant  how to set the value of textfield constant
Column count doesn't match value count at row 1
Column count doesn't match value count at row 1  Column count doesn't match value count at row 1 UPDATE user_profile SET id=[value-1],user_id=[value-2],full_name=[value-3],mobile_phone=[value-4],hide_email_id=[value-5],hide
what is set value or get value mathod?
what is set value or get value mathod?  i create a JTable in this table it containt 3 column or 10 rows. i want to get two value from access file db1 and i want to set third value in third column and set it in again db1? pls tell
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
Why string is storing null value - IoC
it is also storing null value in temp. WHY so...Why string is storing null value  I am reading lines from a file and then splitting it with " " as the criteria If line has first element null
how to allow table editing
how to allow table editing   1**. hi... l've tried the method isCellEditable(int rowIndex, int colIndex) { return true but it doesn't enabled the user the editing of any cell why????????????? regards
Set Date Parameter to get specific value
Set Date Parameter to get specific value  How to set the date parameter or fetch a specific data records based on date? For example fetching the two or three months old records
java.sql.SQLException: Column count doesn't match value count at row 1 - JSP-Servlet
java.sql.SQLException: Column count doesn't match value count at row 1  Hi I am trying to put my data into database. But I found the error of : java.sql.SQLException: Column count doesn't match value count at row 1 I
Why you are not getting value from your data science?
Why you are not getting value from your data science?  Hi, I am... for the tutorials to learn: Why you are not getting value from your data science? Try...;Why you are not getting value from your data science?". Also tell me which
How to set a variable value using velocity
How to set a variable value using velocity       This Example shows you how to set variable value.... #set($list[Ajay, Bhanu, Komal, Shuki, Rakesh
Spring Null value, Set null value in Springs configuration file
Spring Null value, Set null value in Springs configuration file In this example you will see how to set null value in the Spring configuration file. NullBean.java package spring.nullvalue.example
why above code returning the value of squares is 82... even after returning an increnented value of squares... please help me...
why above code returning the value of squares is 82... even after returning an increnented value of squares... please help me...   public class d55 { int squares = 81; public static void main(String
Null value when i set interface object in form controller - Spring
Null value when i set interface object in form controller   Hi all, i am very new about spring and hibernate. i got null value when i set interface object in form Controller. public void setOHBillManager(OHBillManager
Set Interface
elements in a hash table and doesn't allow to store duplicate collections. This class.... It neither contains duplicate elements nor  maps a key value to an object...; It neither contains duplicate elements nor  maps a key value to an object
Java set example
to the collection. As we know set does not allow duplicate elements,  so after.... In java set is a collection that cannot contain duplicate element. The set... to add duplicate elements in the set. The set interface has method which
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page  actually i have to create dynamic... ,rating2......number of buks in that category(and each drop down list has value
duplicate values
duplicate values  My database having cursor that has duplicate values.i want to remove duplicate values through java application
Java code for set...!!!
not allow the duplicate products to be added into the set(equal productId). Hint...Java code for set...!!!  Create 2 classes in same package Product.java productId, name, price ProductImpl.java create a set in this and try
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?  How to change the value of a variable... the value in jsp by using jstl method for eg:'<'c:set var="name1" value="Add User
why java is securable ?
why java is securable ?  why java is securable ?   Hi Friend, Java is secured because of following reasons: 1) It doesn't allow readability as it contains byte code understandable only to JVM.ADS_TO_REPLACE_1 2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
'jpa.sequence' doesn't exist Error Code: 1146 Call: UPDATE SEQUENCE SET SEQ...' doesn't exist  Hi, I am developing an application using JPA 2.1...] Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ
Java duplicate elements
Java duplicate elements  Which class has no duplicate elements
JTable duplicate values in row
JTable duplicate values in row  JTable duplicate values in row
please tell anybody how can i set a value in hiperlink for edit n delete link
please tell anybody how can i set a value in hiperlink for edit n delete link  <logic:present name="allRecords"> <logic:notEmpty name="allRecords"> <logic:iterate id="user" name
ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'allow' How to remove the ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'allow' How to remove the ModuleNotFoundError: No module named 'allow'
Hibernate Envers - REVINFO table doesn't exist
Hibernate Envers - REVINFO table doesn't exist  Hi, In my project I..., but there is no table REFINFO in my database that's why its giving following error: Hibernate Envers - REVINFO table doesn't exist How to resolve this? Thanks
Remove duplicate values
Remove duplicate values  i am trying to insert values into database...:publisher,dc:language in SQL database. in which dc:title will not allow null and dc:dcid is primary key. other attributes can allow null. am trying to insert values
JavaScript duplicate string
duplicate copy of text field value is empty, if it is empty it will float an alert... JavaScript duplicate string...; We can create a strings duplicate string with the use of JavaScript's
Mysql Find Duplicate Records
Mysql Find Duplicate Records       Mysql Find Duplicate Records is used to find the duplicate Records... an example from 'Mysql Find Duplicate Records'. To grasp and understand example
JavaScript duplicate method
JavaScript duplicate method       JavaScript's duplicate method creates a duplicate copy of the specified text range. In this example code we have called the duplicate
PHP duplicate file - PHP
PHP duplicate file   i wanted to duplicate a PHP file resides in different directory on submission
PHP Remove Duplicate Values
. Return Value Another array without duplicate...PHP Array Remove Duplicate Values In PHP if we need to remove duplicate values... an array and returns another array without duplicate values. General
profile doesn't match application identifier
profile doesn't match application identifier  profile doesn't match application identifier
Display non-duplicate words from file
Display non-duplicate words from file In this tutorial, you will learn how to read a text file and display non-duplicate words in ascending order. The given.... We have stored these words into ArrayList. ArrayList allows duplicate values
elasticsearch allow from all
elasticsearch allow from all  Hi, I am in development environment and want to allow the access of ealsticsearch from all the hosts. Program should access elasticsearch allow from all hosts. How to configure elasticsearch
elasticsearch allow from all
elasticsearch allow from all  Hi, I am in development environment and want to allow the access of ealsticsearch from all the hosts. Program should access elasticsearch allow from all hosts. How to configure elasticsearch
Set Tag (Data Tag) Example
;%{'Java'}"/> acts as the name-value pair. Here we set the parameters... Set Tag (Data Tag) Example       In this section, we are going to describe the Set tag. The set tag is a generic tag
JDBC doesn't provide an EOF method.
JDBC doesn't provide an EOF method.  How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method
Why request.getParameter(
Why request.getParameter(  Hi all, I want to to do upload file in my... uploading file is working but data not store in database because my form field value gives null value. Actually problem is i assign form field parameter value
hello .. still doesn't run - Java Beginners
hello .. still doesn't run  Iam still having a prblem in running... explain in details, what do u want to do by this code and why are u importing scanner class? In the code u are creating array which has null value and then u
Reading duplicate keys from .properties file - Development process
will not allow duplicate keys, but still I want to develope a program to identify the duplicate keys and print it on console. It is urgent requirement,please reply...Reading duplicate keys from .properties file  Hi, I am reading
Detecting Duplicate Keys
Detecting Duplicate Keys  Detecting Duplicate Keys I have a program that inserts rows in a table. My table has a column 'Name' that has a unique constraint. If the user attempts to insert a duplicate name into the table, I want
Set interface
Set interface  hello,, What is the Set interface?   hii,ADS_TO_REPLACE_1 The Set interface provides methods for accessing the elements of a finite mathematicalset. Sets do notallow duplicate elements.   Hi
Java Set
Java Set       Collections are objects that hold other objects which are maintained under some set of rules. A set is a public interface that extends the collection interface and comes
duplicate records inserting
duplicate records inserting  in the application i have provided the text filed on entering and submit the record is getting inserted. my question is i want to avoid duplicate values getting inserted. ex. i am inserting name

Ads