online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. *******************************************************************************/ import java.util.AbstractMap; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Map<String, Object> firstMap = new HashMap<>(); firstMap.put("C", "ccc"); firstMap.put("D", "ddd"); firstMap.put("A", "aaa"); firstMap.put("B", "bbb"); Map<String, String> secondMap = new HashMap<>(); secondMap.put("2", "C"); secondMap.put("3", "D"); secondMap.put("0", "A"); secondMap.put("1", "B"); LinkedHashMap<String, String> secondMapOrdered = new LinkedHashMap<>(); secondMapOrdered.put("0", "A"); secondMapOrdered.put("1", "B"); secondMapOrdered.put("2", "C"); secondMapOrdered.put("3", "D"); LinkedHashMap<String, Object> res1 = secondMap.entrySet() .stream() .sorted(Comparator.comparing(Map.Entry::getKey)) .collect(Collectors.toMap(Map.Entry::getValue, k -> firstMap.get(k.getValue()), (x, y) -> y, LinkedHashMap::new)); System.err.println(res1.toString()); LinkedHashMap<String, Object> res2 = secondMapOrdered.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getValue, k -> firstMap.get(k.getValue()), (x, y) -> y, LinkedHashMap::new)); System.err.println(res2.toString()); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue