当前位置:网站首页>June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed.
June 22, 2022: golang multiple choice question, what does the following golang code output? A:3; B:1; C:4; D: Compilation failed.
2022-06-23 08:55: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 .
边栏推荐
- 438. Find All Anagrams in a String
- 6-shining laser application of calayer
- Unique paths for leetcode topic resolution
- Restore the default routing settings of the primary network card
- Subsets II of leetcode topic analysis
- Comprehensive analysis of news capture
- USB peripheral driver - configfs
- 2022.6.22-----leetcode.513
- 1、 Software architecture evaluation
- MQTT+Flink实现实时消息的订阅与发布
猜你喜欢

社区文章|MOSN 构建 Subset 优化思路分享

Testing -- automated testing selenium (about API)

Object. Defineproperty() and data broker

6月《中国数据库行业分析报告》发布!智能风起,列存更生

Install a WGet for your win10

自定义标签——jsp标签增强

636. Exclusive Time of Functions

The first day of employment more than ten years ago

简易学生管理

The fourth online workshop review
随机推荐
636. Exclusive Time of Functions
Third party payment in the second half: scuffle to symbiosis
The results of CDN node and source station are inconsistent
2022.6.22-----leetcode.513
Arclayoutview: implementation of an arc layout
Leetcode topic analysis sort colors
4- draw ellipse, use timer
Geoserver添加mongoDB数据源
Set interface and set sub implementation classes
Quartz Crystal Drive Level Calculation
Longest substring without repeated characters (C language)
New engine, new capability, new experience, Tencent host security flagship release
通用分页(1)
How to restore visualizations and dashboards after kibana rebuilds the index
How to evaluate code quality
Use newbeecoder UI implements data paging
125. Valid Palindrome
How postman does interface testing 1: how to import swagger interface documents
Lighthouse cloud desktop experience
[cloud computing] GFS ideological advantages and architecture