Reference

Java → Go

Filter state lives in the URL and is validated by the route, so this view is bookmarkable, shareable, and survives a refresh. Copy the address bar after filtering.

note
int add(int a, int b)func add(a, b int) inttypes come AFTER names
void f()func f()no void — omit the return type
throws Exception / Pair<A,B>func f() (int, error)multiple return values are native
class Counter { int n; }type Counter struct { n int }struct, not class
void inc() { this.n++; }func (c *Counter) inc() { c.n++ }(c *Counter) is the receiver = explicit this
new Counter()Counter{} / &Counter{}composite literal, no constructors
new Point(1, 2)Point{X: 1, Y: 2}field names, not positions
class Foo implements Bar(nothing)interfaces are satisfied implicitly
public / package-privateCapitalized / lowercasecapitalization IS the access modifier
Math.max(a, b)math.Max(a, b)package-level func = Java static
package com.foo.store;package store (in dir store/)package == directory
import com.foo.*;(illegal)no wildcards; unused import = compile ERROR
pom.xml / jargo.mod / no jarsimport path is a URL
finally / try-with-resourcesdefer f.Close()function-scoped, LIFO
new Thread() / virtual threadgo f()goroutine, ~2KB growable stack
ExecutorService(none needed)the runtime is the scheduler
CountDownLatchsync.WaitGroupAdd / Done / Wait
BlockingQueuechan Tplus select for multiplexing
ThreadLocal / cancellationcontext.Contextpassed explicitly as the first arg
synchronized / ReentrantLocksync.Mutexno keyword, just a struct field
JFR / MAT heap dumppprof + go tool traceprofile-based; no object graph
lambda () -> xfunc() { x }captures the VARIABLE, and it is mutable
JUnit + Maven surefirego test ./...built in; tests live next to the code
Optional<T>(nothing) — use zero values / okv, ok := m[k] is the idiom

24 of 24 rows