Skip to content
yan li edited this page Nov 10, 2021 · 9 revisions

Difference between Go and Java

Java uses JVM Java Compilation

Go compiles code with go compiler to machine code

Go basic

1.Go Package: go language has more than 100 package to do tasks:

  • input and output
  • sorting
  • and text manipulation Java has a lot of packages too. From this point there are no difference between Go and Java as a language.

A program will not compile if there are missing packages or if there are unnecessary packages. better as JAVA e.g.


## Interfaces
Interface types express **generalizations or abstractions** about the behavior s of other types

./prog.go:5:8: imported and not used: "fmt" 
Go build failed.
./prog.go:7:2: undefined: fmt

Go build failed.
``
Clone this wiki locally