当前位置:网站首页>June 24, 2022: golang multiple choice question, what does the following golang code output? A:1; B:3; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai

June 24, 2022: golang multiple choice question, what does the following golang code output? A:1; B:3; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai

2022-06-25 10:37:00 Fuda scaffold constructor's daily question

2022-06-24:golang choice question , following golang What does the code output ?A:1;B:3;C:4;D: Compile failed .

package main

import (
	"fmt"
)

func main() {
    
	var nums1 []interface{
    }
	nums2 := []int{
    1, 3, 4}
	nums3 := append(nums1, nums2)
	fmt.Println(len(nums3))
}

answer 2022-06-24:

Answer selection A.nums2 It's just nums3 An element of .

 Insert picture description here

原网站

版权声明
本文为[Fuda scaffold constructor's daily question]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250957404269.html