Path: csiph.com!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Popping mad Newsgroups: comp.lang.java.programmer Subject: hashtables syntax Date: Sun, 15 May 2016 06:31:50 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: NNTP-Posting-Host: www.mrbrklyn.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1463293910 12232 96.57.23.82 (15 May 2016 06:31:50 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 15 May 2016 06:31:50 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.java.programmer:34289 This whole syntax is new and strange to me, seemingly illogical private static HashMap functions; // built-in function types static { // initialize function types functions = new HashMap<>(); functions.put("floor", new Type[]{Type.FLOAT, Type.INT}); functions.put("sqrt", new Type[]{Type.FLOAT, Type.FLOAT}); functions.put("log", new Type[]{Type.FLOAT, Type.FLOAT, Type.FLOAT}); functions.put("random", new Type[]{Type.FLOAT}); functions.put("parseInt", new Type[]{Type.STRING, Type.INT}); functions.put("parseFloat", new Type[]{Type.STRING, Type.FLOAT}); functions.put("readLine", new Type[]{Type.STRING}); functions.put("showInt", new Type[]{Type.INT, Type.STRING}); functions.put("showFloat", new Type[]{Type.FLOAT, Type.STRING}); } If we are creating a private static Hashmap with template elements of a String and and array of Types, then why do I have to call functions = new HashMap<>(); and why nothing in the template. And what does static do in this case?