看板
[ java ]
討論串[問題] static method
共 8 篇文章
內容預覽:
※ 引述《justinC.bbs@ptt.cc (無)》之銘言:. public class test1 {. public static void main(String args[]) {. System.out.print(test1.more(2, 4, 4, 4));. }. public
(還有409個字)
內容預覽:
==站內文件==. 嗯 先想清楚static的用意. static是用來產生一個"class專屬"的"共用"資料成員或方法. 並不屬於個別的"object". 也就是說static成員 是屬於此class(類別)所專有 且不是object. 所以也就沒有this參考. 又因為宣告static的方法
(還有194個字)
內容預覽:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:. Cannot make a static reference to the non-static method more(int[]) fromt
(還有270個字)