JDK issues

Started by AkipaSP on

Topic category: Help with MCreator software

Active 6 years ago
Joined Feb 2014
Points:
727

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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)
 

Active 1 year ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
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>();

Active 6 years ago
Joined Feb 2014
Points:
727

User statistics:

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

@#1 Thanks