JDK issues

Started by AkipaSP on Mon, 03/20/2017 - 06:40

Topic category: Help with MCreator software

Last seen on 13:22, 1. May 2018
Joined Feb 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
JDK issues
Mon, 03/20/2017 - 06:40

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)
 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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>();

Last seen on 13:22, 1. May 2018
Joined Feb 2014
User points:

User statistics:

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

@#1 Thanks