Which keyword is used to implement an interface in Go?
What is the purpose of an empty interface in Go?
What is the output of the following code?
package main
import "fmt"
func main() {
var x []int
fmt.Println(len(x))
}
What is the purpose of the "net.Conn" interface in Go?
What will be the output of the following code?
package main
import "fmt"
func main() {
var x [3]int = [3]int{1, 2, 3}
y := x
y[1] = 4
fmt.Println(x[1], y[1])
}
What is the purpose of the "sort.Interface" interface in Go?
What is the purpose of the "fmt.Stringer" interface in Go?
Can a struct implement multiple interfaces in Go?
What will be the output of the following program?
package main
import (
"fmt"
)
func main() {
var x interface{} = 5
var y interface{} = "Hello"
fmt.Println(x.(int) + y.(string))
}
Which of the following is not a valid way to implement an interface in Go?