Go丨语言学习笔记--func
Java語(yǔ)言跟Go語(yǔ)言的函數(shù)比較
Go語(yǔ)言
func funcName(input type1,input type2,......)(output type1,output type2,......){
//do something .....
return value1,value2.....
}
Java 語(yǔ)言
public void method1(intput type1,input type2,.....){
//do something
}
public outType method2 (intput type1 ,input type2,......){
//do something
return outTypeValue;
}
備注:Java與Go語(yǔ)言相比 Java的返回type只有一個(gè),而Go語(yǔ)言可以返回type有多個(gè); 并且Go的函數(shù)聲明只有一個(gè)關(guān)鍵字 func
?
博文到此結(jié)束,感謝您的觀看,希望對(duì)各位讀者有所幫助,如果有什么意見(jiàn)以及建議請(qǐng)?jiān)谠u(píng)論留言......
======祝各位讀者生活愉快======
?
轉(zhuǎn)載于:https://www.cnblogs.com/haojieli/p/5659549.html
總結(jié)
以上是生活随笔為你收集整理的Go丨语言学习笔记--func的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。