Linked Questions

86 votes
5 answers
61k views

List.addAll throwing UnsupportedOperationException when trying to add another list [duplicate]

List.addAll throwing UnsupportedOperationException when trying to add another list. List<String> supportedTypes = Arrays.asList("6500", "7600"}; and in loop I am doing, supportedTypes.addAll(...
codingenious's user avatar
  • 8,495
2 votes
3 answers
2k views

java 8: remove element from list if its not found in map key [duplicate]

I would like to remove all list elements, which their last split char not founded as a key in some map. I use following code: List<String> myList = Arrays.asList("a.b.c,c.d.e".split(",")); ...
user1167753's user avatar
0 votes
2 answers
1k views

Iterate through a 2D array and put values to map [duplicate]

I want to iterate though this 2d array and put values into a Map of Strings as key and list of strings Basically i have this but i am not able to modify the value list to add another value in the ...
valik's user avatar
  • 2,034
1 vote
1 answer
1k views

Spring Boot - PostMapping does not working [duplicate]

I am developing spring boot api project. @PostMapping annotation does not running. Why? I added breakpoint but not stopping?? Please help. pom.xml ... <dependencies> <dependency&...
badcode's user avatar
  • 25
0 votes
1 answer
1k views

Add List Throws java.lang.UnsupportedOperationException [duplicate]

I have 4 functions with same get...() method, and I only change the name or identifier, but I've got different result with the fourth which is when to adding new item to list, it throws java.lang....
Hobas Matius's user avatar
-1 votes
1 answer
333 views

Getting java.lang.UnsupportedOperationException in List [duplicate]

I am getting java.lang.UnsupportedOperationException exception in List. Why does this exception occur? Code List<String> smsUserList = new ArrayList<String>(); if (event....
bharathi's user avatar
  • 6,121
-1 votes
2 answers
209 views

How to add string(word) to String[]array?Java, input [duplicate]

So, hello guys. I apologize, if that question has been answered, but I found nothing for my question. Imagine, that there is a guy, who is entering his name into console, and system looks for his ...
Lame Lane's user avatar
-3 votes
2 answers
208 views

Java Unable to add a new list item [duplicate]

I am generating a list from the Registery using the code below. List<String> options = Arrays.asList(Advapi32Util.registryGetStringArray(HKEY_LOCAL_MACHINE, key, value) Later on in the code ...
user1158745's user avatar
  • 2,460
-1 votes
2 answers
394 views

Interface List method add(int index, E element); Why i have UnsupportedOperationEception? [duplicate]

I'm make unit test Interface List. Simple code but i can't understand, why testAdd() throws UnsupportedOperationException but testSet() do not throws this exception. public class testList { ...
diofloyk's user avatar
  • 133
1 vote
0 answers
25 views

Getting UnsupportedOperationException [duplicate]

private void createObject(List<Activities> listOfActivities){ ABC object1 = new ABC(); String value = ""; for (Activities list : listOfActivities) { if (list instanceof XYZ) { ...
Sangeet's user avatar
  • 145
4318 votes
35 answers
1.7m views

What are the differences between a HashMap and a Hashtable in Java?

What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded applications?
dmanxiii's user avatar
  • 51.9k
294 votes
12 answers
131k views

What is the difference between Serializable and Externalizable in Java?

What is the difference between Serializable and Externalizable in Java?
user avatar
1 vote
3 answers
4k views

deleting an element in debug mode in eclipse

I'm running my code in debug mode in eclipse and in the middle of it, I want to change the size of a List,say from 9 to 6, by deleting 3 elements. But I'm not seeing any option to do that, in fact ...
gautam's user avatar
  • 197
2 votes
1 answer
3k views

Groovy: Creating a list with range operator

I was trying to pick a random element from a list of int and the list elements are created with range operator: def date_range = 1..28 assert ('a'..'d').collect() == ['a','b','c','d'] // So this is ...
Mahbub Rahman's user avatar
6 votes
4 answers
185 views

(Array) List implementations in Java

Issue with array list implementation: My code List<Integer> arrayList=new ArrayList<Integer>(3); arrayList=Arrays.asList(10,20); System.out.println(arrayList.size()); //arrayList.add(30)...
nagesh's user avatar
  • 61

15 30 50 per page