看板 java 關於我們 聯絡資訊
interface Move { public int walk=1; public int run=2; public int jump=3; public void moving(int move); } interface Hole { public void holing(); } class Mouse implements Move,Hole { public void moving(int move) { switch(move) { case walk: break; case run: break; case jump: break; } } public void holing() { } } 想請問雖然interface 裡面的變數 可以拿來當switch case的判斷 是不是因為它是自動設定interface裡面的attribute為const阿? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.169.113.157
PsMonkey:這... 我看不懂問題... 有人可以幫補嗎? 04/11 02:00