answersLogoWhite

0


Best Answer

A List is an ordered collection of elements.

A Set is a collection of unique elements.

Sets should be used when you want to store objects without duplicates. Lists should be used any time you need to store an unknown number of objects.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between list and set in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between Java 1.6 and Java 1.7?

Java 1.7 supports the features of 1.6 but introduces some new conventions:- Java 7 allows use of String object in the expression of a switch statement.- Auto-closing of resources (also known as try-with-resources)- Allow catching of multiple Exceptions- Allows underscores in Numeric Literal for readability (e.g. 1_234_567_890_123_456L)- Substitute the parameterized type of the constructor with an empty set of type parameters ()For full list see Java Programming Language Enhancements.


What is the difference between an algorithm and java code?

In Java programming language, an algorithm refers to a sequence of instructions that have been specified to undertake a particular task within a certain time. An algorithm can take no or several inputs but will generate at least one output.


What is the difference between a constant and a variable in java programming language?

A constant in Java is defined using the "final" modifier. For instance: final double Density_Of_Water = 1.000; would set Density_Of_Water to 1.000. This value can not be modified throughout the program because "final" told the compiler that this value would not change. A variable however, can be changed by the user throughout the program.


Why java is the name of programming language?

James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects.[5] The language, initially called Oak after an oak tree that stood outside Gosling's office, also went by the name Green and ended up later renamed as Java, from a list of random words. http://en.wikipedia.org/wiki/Java_(programming_language)


Who discovered java and when?

java was discovered by James gosling and Co. in 1991 at sun micro systems..they renamed oak to java..initially java used in programming for set top boxes (for movie on demand..)

Related questions

Is there any difference between java and j2SE?

Core Java and J2SE are the same thing, which is the set of classes to be found in the rt.jar package. The classes were just given different names at different stages of the continued revisions to the Java Runtime Environment.


What is the difference between a set and a map in java?

set :-set have only values,and it dont allows duplicate values.set allows original values.map:-map have keys and values.if we know keys,and autometically knows to values.


What is the on-screen difference between JTextField and JTextArea in java?

JTextField is a one-line text box, while JTextArea can be set to span multiple lines of input.


What is the difference between Java 1.6 and Java 1.7?

Java 1.7 supports the features of 1.6 but introduces some new conventions:- Java 7 allows use of String object in the expression of a switch statement.- Auto-closing of resources (also known as try-with-resources)- Allow catching of multiple Exceptions- Allows underscores in Numeric Literal for readability (e.g. 1_234_567_890_123_456L)- Substitute the parameterized type of the constructor with an empty set of type parameters ()For full list see Java Programming Language Enhancements.


What is difference between jvmjre and jdk?

JVM Stands for Java Virtual Machine. JVM is the virtual machine in which a java program gets executed. JRE stands for Java Runtime Environment. JRE is the runtime set up that is required by the JVM to execute java programs. JDK stands for Java Development Kit. JDK is the basic software that gets downloaded from sun's java website if anyone wants to use java.


How do you set core java class path?

in Windows : specify environment variable as classpath orset classpath="list of directories" e.g. set classpath="C:\java\lib"in Linux export CLASSPATH="your classpath" e.g. export CLASSPATH="/home/java/lib"


Define set in java?

A Java set is a collection of things that do not contain duplicate elements. Duplicates are prohibited from Java sets.


What is a difference between a collection and a set?

None. A set is a collection and a collection is a set.


What is the difference between a master plan and a strategic development plan?

A master plan is a set of goals that need to be accomplished. A strategic development plan is a list of things that need to be done to accomplish set goals.


What is the difference between an algorithm and java code?

In Java programming language, an algorithm refers to a sequence of instructions that have been specified to undertake a particular task within a certain time. An algorithm can take no or several inputs but will generate at least one output.


What is the difference between a system of numerals and a set of numbers?

there is a huge difference. :)


What is the difference between the greatest and least numbers in the set of data is called?

The difference between the greatest and least numbers in a set of data is called the range.