Skip to main content

Posts

Showing posts from May, 2017

Go For Java Developers

Data Types:String  --> string (defaults to "")Integer --> int    (defaults to 0)Double --> float (defaults to 0.0)Boolean --> bool (defaults to false)    final equivalent      const x string = "text"      Define      String x   -->    var x string    Initialize     x = "text" --> x = "text"   Define & Initialize     String x = "text" --> x := "text"
   Collection      List list = new ArrayList<>();   --> var list []string                                                                       --> list := []string{"text"}                                                                       --> list = append(list, "another text")
    Map map = new HashMap<>():
       var x map[string]int  where string is key and int is value.        x["key1"] = 10    Control Statements      if/for/switch if (condition) {} --> if (condition) {}     e.g.      if (10 >= …