Type mismatch: cannot convert from element type Object to List

Happy Man

I got this error: "Type mismatch: cannot convert from element type Object to List" in "subLists" "and Type mismatch: cannot convert from element type Object to String" in "accList"

Code:

ArrayList subLists = new ArrayList();

for (List accList : subLists) {
        service.submit(() -> {
            for (String account : accList) {
                accounts.remove(account);
                String[] split = account.split(":");
                String email = split[0];
                String password = split[1];
                AuthResult result = null;
azro

You did not specify what type of object was in the different lists, you need to, the programm won't guess :

List<List<String>> subLists = new ArrayList<>();  

for (List<String> accList : subLists) {
    service.submit(() -> {
        for (String account : accList) {
// ...

Also, better use Interfaces than Implementations to store the variable, easier to update (List<List<String>> rather than ArrayList<List<String>>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Type mismatch: cannot convert from element type Object to Cookie

From Dev

type mismatch cannot convert from element type object to string

From Dev

Java - Type mismatch: cannot convert from element type Object to String

From Dev

type mismatch cannot convert from element type object to string

From Dev

Type mismatch: cannot convert from element type Object to Cookie

From Dev

Java - Type mismatch: cannot convert from element type Object to String

From Dev

issue with java 8 collectors Type mismatch: cannot convert from List<Object> to List<String>

From Dev

Type mismatch: cannot convert from Object to Class object

From Dev

Type mismatch: cannot convert from Object to Class object

From Dev

Java generics. Type mismatch: cannot convert from object to

From Dev

Type mismatch: cannot convert from Optional<Object> to BasketDTO

From Dev

spark Type mismatch: cannot convert from JavaRDD<Object> to JavaRDD<String>

From Dev

error : Type mismatch: cannot convert from Object to JSONObject

From Dev

Java generics. Type mismatch: cannot convert from object to

From Dev

Type mismatch: cannot convert from Set<Object> to Set<Long>

From Dev

Type mismatch: cannot convert from boolean to int

From Dev

Type mismatch: cannot convert from ListFragment to Fragment

From Dev

Type mismatch: cannot convert from long to int

From Dev

type mismatch: cannot convert from double to Double

From Dev

Type mismatch cannot convert from String to String[]

From Dev

Type mismatch: cannot convert from Scanner to boolean

From Dev

Type mismatch: cannot convert from void to Integer

From Dev

Type mismatch: cannot convert from int to TextView

From Dev

Type mismatch: cannot convert from void to int

From Dev

Type mismatch : cannot convert from double[][] to double[]

From Dev

Type mismatch: cannot convert from boolean to double

From Dev

Type mismatch cannot convert from String to String[]

From Dev

Type mismatch: cannot convert from double to double[]

From Dev

Type mismatch: cannot convert from void to Thread

Related Related

  1. 1

    Type mismatch: cannot convert from element type Object to Cookie

  2. 2

    type mismatch cannot convert from element type object to string

  3. 3

    Java - Type mismatch: cannot convert from element type Object to String

  4. 4

    type mismatch cannot convert from element type object to string

  5. 5

    Type mismatch: cannot convert from element type Object to Cookie

  6. 6

    Java - Type mismatch: cannot convert from element type Object to String

  7. 7

    issue with java 8 collectors Type mismatch: cannot convert from List<Object> to List<String>

  8. 8

    Type mismatch: cannot convert from Object to Class object

  9. 9

    Type mismatch: cannot convert from Object to Class object

  10. 10

    Java generics. Type mismatch: cannot convert from object to

  11. 11

    Type mismatch: cannot convert from Optional<Object> to BasketDTO

  12. 12

    spark Type mismatch: cannot convert from JavaRDD<Object> to JavaRDD<String>

  13. 13

    error : Type mismatch: cannot convert from Object to JSONObject

  14. 14

    Java generics. Type mismatch: cannot convert from object to

  15. 15

    Type mismatch: cannot convert from Set<Object> to Set<Long>

  16. 16

    Type mismatch: cannot convert from boolean to int

  17. 17

    Type mismatch: cannot convert from ListFragment to Fragment

  18. 18

    Type mismatch: cannot convert from long to int

  19. 19

    type mismatch: cannot convert from double to Double

  20. 20

    Type mismatch cannot convert from String to String[]

  21. 21

    Type mismatch: cannot convert from Scanner to boolean

  22. 22

    Type mismatch: cannot convert from void to Integer

  23. 23

    Type mismatch: cannot convert from int to TextView

  24. 24

    Type mismatch: cannot convert from void to int

  25. 25

    Type mismatch : cannot convert from double[][] to double[]

  26. 26

    Type mismatch: cannot convert from boolean to double

  27. 27

    Type mismatch cannot convert from String to String[]

  28. 28

    Type mismatch: cannot convert from double to double[]

  29. 29

    Type mismatch: cannot convert from void to Thread

HotTag

Archive