3 ms·
In my eyes, Java and Go have very little in common beyond that they are both garbage collected languages. Go has been created by experienced C programmers and t
by _ph_ 8y ago
In my eyes, Java and Go have very little in common beyond that they are both garbage collected languages. Go has been created by experienced C programmers and the heritage shows. Java is completely object-oriented, based on byte-code which gets JITed by a VM. All complex types have to be objects and are always handled by references - you cannot make an array of objects, you can only have an array of references.
Go is statically compiled into a statically linked executable. Go has structs as complex types. They are handled by value, unless you specifically use pointers. Structs can contain other structs as values, without requiring the indirection and the overhead of references. The same applies for arrays.
You can have methods on any type, including structs, but you can also just have functions.