JDK issues

Started by AkipaSP on

Topic category: Help with MCreator software

Joined Feb 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
JDK issues

error: diamond operator is not supported in -source 1.6
          private final Map> adaptableValues = new HashMap();
                                                                                        ^
  (use -source 7 or higher to enable diamond operator)
 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The diamond operator is this:
Mon, 03/20/2017 - 12:02

The diamond operator is this: <>
It has been added to Java 7, mainly for simplifying instantiation of some generic classes. 
So for example you can do
HashMap<Integer> values = new HashMap<>();

Well, in older versions the diamond operator is not supported, so you need to use
HashMap<Integer> values = new HashMap<Integer>();

Joined Feb 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:The diamond operator is this:
Mon, 03/20/2017 - 12:24

@#1 Thanks