当前位置:网站首页>June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai
June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai
2022-06-23 05:40:00 【Fuda scaffold constructor's daily question】
2022-06-22:golang choice question , following golang What does the code output ?A:3;B:1;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-22:
Answer selection D. Compiler error cannot use nums2 (type []int) as type []interface {} in append.int Belong to interface{},[]int Do not belong to []interface{}. Son belongs to Lao Tzu , Sons do not belong to Lao Tzu .

边栏推荐
- markdown给图片加背景色
- The weak are as irritable as tigers, the strong are as calm as water, and the really powerful have already given up their emotions
- Seata四大模式之XA模式详解及代码实现
- jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定
- Go language - use of packages
- App automated test appium advanced
- Stm32cube serial port uses dma+idle to receive variable length data
- After the idea code is developed, the code is submitted. If the branch is found to be incorrect after submission, how can I withdraw it
- Complete one-time GC process of JVM principle
- Wechat applet: production and generation of love guarantee
猜你喜欢

Introduction to unityshader -- rendering optimization technology in unity (IV)

Win11 app store keeps turning around solution

markdown给图片加背景色

What if win11 cannot record audio? Solution of win11 unable to input sound

云原生数据库是未来数据库的天下

visdom画多条动态损失曲线

云原生架构(04)-CNCF

STC 32 Bit 8051 Single Chip Computer Development Example Tutorial one development environment

Memory model of JVM principle

Lihongyi, machine learning 5 Tips for neural network design
随机推荐
The road of architects starts from "storage selection"
51万奖池邀你参战——第二届阿里云ECS CloudBuild开发者大赛来袭
STC 32-bit 8051 MCU development example tutorial I development environment construction
Mathematical analysis_ Notes_ Chapter 1: set and mapping
Wechat applet: production and generation of love guarantee
Introduction to MySQL (II) sub query + Association
账号多开是什么意思?为什么要账号多开?如何安全实现?
IP6809三线圈15W无线充电发射端方案ic英集芯
Shifu, the open source development platform of the Internet of things, is open for internal testing! Release of the first version of technical documents
Xa mode explanation and code implementation of four Seata modes
[opencv450] image subtraction, binarization, threshold segmentation
Stm32cube serial port uses dma+idle to receive variable length data
Low cost 5W wireless charger scheme fs68001b simple charging chip
FS4059A与FS5080E充电芯片的区别
云原生数据库是未来数据库的天下
低成本5W无线充电器方案FS68001B简便充电芯片
Markdown add background color to the picture
Konva series tutorial 1:what is konva?
面对新的挑战,成为更好的自己--进击的技术er
Is there a real part-time job online? How do college students find part-time jobs in summer?