当前位置:网站首页>2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。 package main import ( “fmt“ ) func mai
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。 package main import ( “fmt“ ) func mai
2022-06-23 03:52:00 【福大大架构师每日一题】
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
package main
import (
"fmt"
)
func main() {
var nums1 []interface{
}
nums2 := []int{
1, 3, 4}
nums3 := append(nums1, nums2...)
fmt.Println(len(nums3))
}
答案2022-06-22:
答案选D。编译报错cannot use nums2 (type []int) as type []interface {} in append。int属于interface{},[]int不属于[]interface{}。儿子属于老子,儿子们不属于老子们。

边栏推荐
- 396. mine site construction
- [paper reading] semi supervised learning with ladder networks
- Abnova liquidcell negative enrichment cell separation and recovery system
- Project summary 1 (header file, switch, &, bit variables)
- Laravel中使用 Editor.md 上传图片如何处理?
- 云原生数据库如荼如火,未来可期
- 物体结构图,快速图解物体内部结构
- Abnova ACTN4纯化兔多克隆抗体说明书
- Transformers中的动态学习率
- 实战| 记一次借Viper来多重内网渗透
猜你喜欢
随机推荐
Current relay jdl-1002a
prometheus、influxdb2.2安装及flume_export下载编译使用
mysql json
Composer by installation laravel
Thinkphp6 linked table query without associated ID (2 tables) is mainly the application of select
Static two position relay xjls-84/440/dc220v
const理解之二
项目总结1(头文件,switch,&&,位变量)
The solution to prompt "this dictionary creation could be rewritten as a dictionary literal" when updating the dictionary key value in pychart
Mini Homer——几百块钱也能搞到一台远距离图数传链路?
Abnova acid phosphatase (wheat germ) instructions
Parameter passing of 18 generator function
How can mushrooms survive a five-year loss of 4.2 billion yuan?
Summary of switched reluctance motor suspension drive ir2128
Left and right values
ICer技能02makefile脚本自跑vcs仿真
Laravel中使用 Editor.md 上传图片如何处理?
DSP7 环境
ICer技能02makefile脚本自跑vcs仿真
2020:VL-BERT: Pre-training of generic visual-linguistic representation








