Can a Go interface have fields?
- Depends on the implementation
- No
- Only if it's a pointer
- Yes
No, a Go interface cannot have fields. It only defines a set of methods that a concrete type must implement.
Loading...
Related Quiz
- Gorilla Mux can handle route parameters with different data types by _______.
- In Go benchmarks, what does the 'b.ReportAllocs()' function do?
- MongoDB provides _______ which is a sharding configuration to distribute data across multiple servers.
- How would you open a file for reading in Go?
- The _____ function can be used in Go to reset the timer of a benchmark, giving a more accurate measure of performance.