IDEA常用快捷键:
- Alt+Shift+F10 运行代码
- 选中代码:Ctrl + / 注释 //
- 选中代码: Ctrl +Shift + / 注释 /* */
- psvm +回车 生成main方法:
public static void main(String[] args) {
}
- sout +回车
System.out.println("");
}
-
Alt + <-- 进入方法。 Alt + -->出来方法
-
Ctrl+Alt+L 格式化排版
-
自动导包:
file --seting
-
Ctrl +Shift +回车:向下插入一行
-
在(" “)里面按Enter ,自动跳出+” "
System.out.println("HelloWorld" +
"");
- itar +回车 生成a rray for代码块:
for (int i = 0; i < args.length; i++) {
String arg = args[i];
}
- itco +回车 生成Collection迭代
for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {
Object next = iterator.next();
}
- iten +回车 生成enumeration遍历
while (enumeration.hasMoreElements()) {
Object nextElement = enumeration.nextElement();
- iter +回车 生成arg
for (String arg : args) {
}
- itit +回车 生成iterator 迭代 :
while (iterator.hasNext()) {
Object next = iterator.next();
}
- itli +回车 生成List的遍历
for (int i = 0; i < list.size(); i++) {
Object o = list.get(i);
}
- ittok +回车 生成String token遍历:
for (StringTokenizer stringTokenizer = new StringTokenizer(); stringTokenizer.hasMoreTokens(); ) {
String s = stringTokenizer.nextToken();
}
- itve +回车 生成Vector数组迭代 :
for (int i = 0; i < vector.size(); i++) {
Object elementAt = vector.elementAt(i);
}
20 itaws + 回车 . 生成Axis2 web service调用
try {
MyServiceStub stub = new MyServiceStub();
stub.sayHelloWorldFrom();
} catch (Exception ex) {
ex.printStackTrace();
}
- itws +回车 生成 Axis web service调用
try {
MyServiceLocator locator = new MyServiceLocator();
Activator service = locator.get();
// If authorization is required
//((MyService_Soap_BindingStub)service).setUsername("user3");
//((MyService_Soap_BindingStub)service).setPassword("pass3");
// invoke business method
service.businessMethod();
} catch (javax.xml.rpc.ServiceException ex) {
ex.printStackTrace();
} catch (java.rmi.RemoteException ex) {
ex.printStackTrace();
}