Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 063f89f commit 7beb9c4Copy full SHA for 7beb9c4
com/elephant/util/New.class
1.15 KB
com/elephant/util/New.java
@@ -0,0 +1,28 @@
1
+package com.elephant.util;
2
+import java.util.*;
3
+
4
+public class New{
5
+ public static <K,V> Map<K,V> map(){
6
+ return new HashMap<K,V>();
7
+ }
8
+ public static <T> List<T> list(){
9
+ return new ArrayList<T>();
10
11
+ public static <T> LinkedList<T> lList(){
12
+ return new LinkedList<T>();
13
14
+ public static <T> Set<T> set(){
15
+ return new HashSet<T>();
16
17
+ public static <T> Queue<T> queue(){
18
19
20
21
+ public static void main(String[] args){
22
+ Map<String,List<String>> msl=New.map();
23
+ List<String> ls=New.list();
24
+ LinkedList<String> lls=New.lList();
25
+ Set<String> ss=New.set();
26
+ Queue<String> qs=New.queue();
27
28
+}
0 commit comments