函数
来源:互联网 发布:java小写字母转大写 编辑:程序博客网 时间:2024/05/29 14:40
函数的定义: 函数名,参数,返回值
func 函数名字(参数)->返回值类型
class ViewController: UIViewController {
overridefunc viewDidLoad() {
super.viewDidLoad()
print(eatFoodKind(kind:"apple"))
drinkWater(name:"who")
}
//1.带返回值
func eatFoodKind(kind:String) ->String {
return kind;
}
//2.不带返回值
func drinkWater(name:String){
print("\(name) is DrinkWater")
}
overridefunc didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
0 0
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- easy-ui textbox blur?change?
- 看黑客如何利用社会工程学获取你的密码
- Remote debug error with GDB(remote register badly formatted)
- 链接传送门(个人备忘)
- 谈钱考验感情:小雷同志,你薪水几何?
- 函数
- android studio修改项目包名
- jsoup
- iOS 获取点击位置
- leetcode -- Binary search (6)
- Android之旅第二站——界面(控件)…
- 解决 ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
- UE4 入门第一课 创建和打开一个UE4工程
- 关于环形链表的建立,删除,插入操作演示