JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » JavaFX 討論區 » JavaFX Script  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
作者 兩種寫法有差別嗎
bruce0819





發文: 14
積分: 0
於 2011-10-01 10:54 user profilesend a private message to usersend email to bruce0819reply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
這樣寫是可以編譯的
1
2
3
var myFunction2:function(:Integer,:Integer):Integer;
myFunction2 = function(a : Integer, k : Integer) { a+k }
println(myFunction2(4,2));


這樣寫是錯誤的
1
2
var myFunction2:function(a : Integer, k : Integer):Integer { a+k };
println(myFunction2(4,2));


錯誤訊息是
You have forgotten the ';', which is needed to separate one expression from the next.

為甚麼呢?


bruce0819 edited on 2011-10-01 11:00
reply to postreply to post
作者 Re:兩種寫法有差別嗎 [Re:bruce0819]
a0917009769





發文: 23
積分: 0
於 2011-12-26 12:21 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
沒寫過JavaFX 會不會是function不需要加上";"呢?

reply to postreply to post
» JWorld@TW »  JavaFX 討論區 » JavaFX Script

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8