The example will prompt user to create an empty map with the emptyMap() method.
Source Code
package com.beginner.examples;
import java.util.Collections;
import java.util.Map;
public class EmptyMapExample {
public static void main(String a[]){
// use emptyMap()
Map map = Collections.emptyMap();
System.out.println("Map: " + map);
}
}
Output:
Map: {}
References
Imported packages in Java documentation: