...

/

Quiz: Deduce the Outputs

Quiz: Deduce the Outputs

In this lesson, your concepts will be evaluated through a quiz.

We'll cover the following...

Choose one possible correct answer

1.

Deduce the output of the following program:

package main
import "fmt"

type Any interface {}
type Anything struct {}

func main() {
	any := getAny()
	if any == nil {
		fmt.Println("any is nil")
	} else {
		fmt.Println("any is not nil")
	}
}

func getAny() Any {
	return getAnything()
}
func getAnything() *Anything {
	return nil
}
A.

any is nil

B.

any is not nil

C.

Compiler Error

D.

any is nil any is not nil


1 / 3

We hope that you ...