how to identify duplicate values in arraylist
Answers were Sorted based on User's Feedback
Answer / shrinu nallavelli
arrayList elements are differentiated by their index values
onlu..
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / srikanth m
List<String> list = new ArrayList<String>();
list.add("abc");
list.add("def");
list.add("abc");
HashMap<String, Integer> map = new HashMap<String, Integer>();
for (String str : list) {
Integer c = (Integer) map.get(str);
if (c == null || c == 0) {
map.put(str, 1);
} else {
map.put(str, ++c);
}
}
System.out.println(map);
| Is This Answer Correct ? | 0 Yes | 0 No |
When finalize method is called?
Is main a keyword in java?
Difference between Array and vector?
What is java autoboxing?
placement papaers of spring computing technology
0 Answers Spring Computing Technologies,
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu
What is empty list in java?
Write a program to solve producer consumer problem in java?
How to Sort Strings which are given in List and display in ascending order without using java api.
What is abstract class? Explain
Same common question what is Map,Set,HashMap,List????
Hi Every One I Have Small Doubt Please answer This???????????????????????????? I Want to use AbstractList class methods(java.util.AbstractList) My Program is import java.util.*; class DemoOne extends AbstractList { public static void main(String[] args) { AbstractList a=new DemoOne();//This One is Correct?? DemoOne a1=new DemoOne();//This One is Correct?? Both Are Not Working System.out.println("Hello World!"+a); System.out.println("Hello World!"+a1); } } Error IS: DemoOne.java:2: DemoOne is not abstract and does not override abstract method get(int) in java.util.AbstractList class DemoOne extends AbstractList AnyOne can Please Provide The Solution????????????????????????? Plzzzzzzz