[Fixed] insert dimensions to complete referencetype

In this post, we will see about error insert dimensions to complete referencetype.

You will get this error when you are trying to pass primitive objects into generic type declaration but generic always expect a Wrapper class in java.

For example:
Let’s say you have the below class named InsertDimensionlMain.java.

Above code won’t compile, you will a compilation error with "insert dimensions to complete referencetype".

You can solve this issue by replacing int by its wrapper class Integer in Map declaration.

Let’s see another example with ArrayList.

Here also we will get same issue.

You can solve this issue by replacing double by its wrapper class Double.

That’s all about how to resolve insert dimensions to complete referencetype in java.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *