“Cannot create generic array of ..” - how to create an Array of Map?

前端 未结 6 2148
粉色の甜心
粉色の甜心 2020-11-28 11:39

I would like to use simpleJdbcInsert class and executeBatch method

public int[] executeBatch(Map[] batch)

http://stati

6条回答
  •  忘掉有多难
    2020-11-28 12:20

    As far my knowledge

    Frist try to create an array of java.lang.Object and then cast to Generic type T

    Example:

    class Example{
        public DataType array = (DataType[]) new Object[5] ; 
    }
    

    In this way, you can create an array of generic datatype

提交回复
热议问题