Go for Java Programmers: Packages, Functions, and Variables | Java Code Geeks

See on Scoop.itProgramming

Go’s Familiar Syntax Due to their shared heritage in the C programming language, Go (aka Golang) code should be fairly recognizable to a Java developer.  Here is the canonical “Hello world” program, which you can execute and modify through your browser on the Go Playground site:           package main import “fmt” func main() { fmt.Println(“Hello world”) } Functions and control structures begin and end with curly-braces.  Function parameters are enclosed in parentheses, with empty parentheses for functions having zero parameters.  Strictly speaking, Go statements terminate with semicolons just as in Java, although the convention is to let the compiler insert them implicitly.  The naming convention for variables and functions is “camelCase”, rather than using underscores (Python people tend to hate this!). Other Go fundamentals closely mirror their Java counterparts, too.  Go code is grouped into “packages”.  A function main(), located in the package main, is th

Camilo Rivera‘s insight:

Wanna go?

See on www.javacodegeeks.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s