看板 [ java ]
討論串[問題] static method
共 8 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者justinC (無)時間19年前 (2006/06/19 22:51), 編輯資訊
0
0
0
內容預覽:
引述《H45.bbs@binary.csie.ncu.edu.tw (大家來創社 ^^//)》之銘言:這個解釋就很容易懂. 那static method 不能存取non-static的變數. 也是這個道理~. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 61.221.1

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者H45.時間19年前 (2006/06/19 20:01), 編輯資訊
0
0
0
內容預覽:
引述《justinC.bbs@ptt.cc (無)》之銘言:. public class test1 {. public static void main(String args[]) {. System.out.print(test1.more(2, 4, 4, 4));. }. public
(還有409個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者BadKido (BadKido)時間19年前 (2006/06/19 18:07), 編輯資訊
0
0
1
內容預覽:
==站內文件==. 嗯 先想清楚static的用意. static是用來產生一個"class專屬"的"共用"資料成員或方法. 並不屬於個別的"object". 也就是說static成員 是屬於此class(類別)所專有 且不是object. 所以也就沒有this參考. 又因為宣告static的方法
(還有194個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者justinC (無)時間19年前 (2006/06/19 18:00), 編輯資訊
0
0
0
內容預覽:
還有問題. 雖然沒產生物件. 但是在同class 底下 使用function還要加個static. 一直想不出為什麼一樣都是class下的member function還要這樣做呢?. 謝謝~. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 61.221.120.127.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者qrtt1 (隱者)時間19年前 (2006/06/19 17:44), 編輯資訊
0
0
0
內容預覽:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:. Cannot make a static reference to the non-static method more(int[]) fromt
(還有270個字)
首頁
上一頁
1
2
下一頁
尾頁