生成 注釋
應該是選取要注釋內(nèi)容后, ctrl+shift+c 按一下注釋,按兩下取消注釋
ctrl+shift+"反注釋!能講ctrl+shift+/ 多行注釋掉的內(nèi)容反注釋掉
CTRL+T 查看接口的實現(xiàn)
MyEclipse調(diào)試
1.首先在一個java文件中設斷點,然后運行debug,當程序走到斷點處就會停下。
2.F5鍵與F6鍵均為單步調(diào)試,
F5是step into,也就是進入本行代碼中執(zhí)行(進入函數(shù)執(zhí)行),
F6是step over,也就是執(zhí)行本行代碼,跳到下一行執(zhí)行(不進入函數(shù)),
3.F7是跳出函數(shù) step return
4.F8是執(zhí)行到最后。
=====================================
1.Step Into (F5) 跳入
2.Step Over (F6) 跳過
3.Step Return (F7) 執(zhí)行完當前method,然后return跳出此method
4.step Filter 逐步過濾
一直執(zhí)行直到遇到未經(jīng)過濾的位置或斷點(設置Filter:window-preferences-java-Debug-step
Filtering)
5.resume 重新開始執(zhí)行debug,一直運行直到遇到breakpoint
6.hit count 設置執(zhí)行次數(shù) 適合程序中的for循環(huán)(設置 breakpoint view-右鍵hit
count)
7.inspect 檢查 運算。執(zhí)行一個表達式顯示執(zhí)行值
8.watch 實時地監(jiān)視變量的變化
9.我們常說的斷點(breakpoints)是指line breakpoints,除了line
breakpoints,還有其他的斷點類型:field(watchpoint)breakpoint,method
breakpoint,exception breakpoint.
10.field breakpoint 也叫watchpoint(監(jiān)視點) 當成員變量被讀取或修改時暫掛
11.添加method breakpoint 進入/離開此方法時暫掛(Run-method breakpoint)
12.添加Exception breakpoint 捕抓到Execption時暫掛(待續(xù)...)
斷點屬性:
1.hit count 執(zhí)行多少次數(shù)后暫掛 用于循環(huán)
2.enable condition 遇到符合你輸入條件(為ture\改變時)就暫掛
3.suspend thread 多線程時暫掛此線程
4.suspend VM 暫掛虛擬機
13.variables 視圖里的變量可以改變變量值,在variables 視圖選擇變量點擊右鍵--change
value.一次來進行快速調(diào)試。
14.debug
過程中修改了某些code后--〉save&build-->resume-->重新暫掛于斷點
===========================
例如你有如下程序:
public class debugtest {
來源:(http://blog.sina.com.cn/s/blog_624aa0960100fkrr.html)
- MyEclipse調(diào)試_匆匆過客_新浪博客
public String addDays() {
System.out.println("1");//
=============》(3)
String result = "";
//=============》(4)
System.out.println("2");//
=============》(5)
return result;
}
public static void main(String args[]) {
debugtest aa = new
debugtest();
int ii=9;
aa.addDays();//
=============》(1)
System.out.println("eeeeeeeeeeeeeee");//=============》(2)
}
}
你在(1)處加斷點,運行到此處時如果Step Into (F5)為跳入(進入函數(shù)),則接著執(zhí)行到(3)。
再執(zhí)行Step Over (F6)執(zhí)行本行,則執(zhí)行到(4)。
最后執(zhí)行Step Return (also F7),則跳出addDays方法,跳到(2)
轉(zhuǎn)http://blog.sina.com.cn/s/blog_624aa0960100fkrr.html
MyEclipse 中顯示行號 要想顯示行號,按住 Ctrl + F10 選擇 show Line Numbers
eclipse/myeclipse注釋模板的修改 alt+shitf+j
Window --> Java --> Code Style --> Code Templates --> Comments --> types --> Edit
/**
*
* 項目名稱:${project_name}
* 類名稱:${type_name}
* 類描述:
* 創(chuàng)建人:${user}
* 創(chuàng)建時間:${date} ${time}
* 修改人:${user}
* 修改時間:${date} ${time}
* 修改備注:
* @version
*
*/
http://www.javaeye.com/topic/585168
myeclipse中如何配置自定義的代碼排版格式 ctrl+shift+f