Re: [問題] ?:問題

看板java作者 (骨頭)時間19年前 (2006/06/19 05:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/5 (看更多)
※ 引述《justinC (無)》之銘言: : int a=1; : a>=1?System.out.print("YES"):System.out.print("NO"); : 我在java用這種寫法不行 : 但在c++上的a>=?cout<<"yes":cout<<"no";卻可以 : 請問java的三元運算子的使用(特性)是否有一點點較其他語言不同? System.out.println( (a>=1)?"YES":"NO"); Java的 ?: 主要使用於傳值 , 而非執行動作..... -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the complier will stack.push(scouting.buck()); | answer your life stack.push(bowling.pratice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.240.58
文章代碼(AID): #14bSWQhZ (java)
討論串 (同標題文章)
本文引述了以下文章的的內容:
以下文章回應了本文
完整討論串 (本文為第 3 之 5 篇):
文章代碼(AID): #14bSWQhZ (java)