• IDEA编写快捷生成代码


    1. psvm

    //生成main方法:
     public static void main(String[] args) {}

    2. sout

    //生成打印输出:
    System.out.println();

    3. "abc".sout

    //生成打印字符串:
    System.out.println("adc");

    4. "abc".format 

    //生成字符串格式化:
    String.format("abc", )

    //如List或者Array: List<String> list = new ArrayList<>(); 
    5. itli 

    //生成for循环
    for (int i = 0; i < list.size(); i++) {
           String s =  list.get(i);
    }

    6. itco

    // 生成Collection迭代器
      for (Iterator<String> iterator = list.iterator(); iterator.hasNext(); ) {
            String next =  iterator.next();   
    }

    7. iter 

    ///生成增强for循环
        for (String s : list) {       
        }

    8.iten

     ///生成 enumeration遍历
       while (enumeration.hasMoreElements()) {
             Object nextElement =  enumeration.nextElement();   
        }

    9. itar

      ///生成数组for循环
      int[] array = {1,2,3,4,5};
       for (int i = 0; i < array.length; i++) {
            int i1 = array[i]; 
        }

    10. itit

        ///生成迭代器 iterator
         Iterator iterator = list.iterator();
         while (iterator.hasNext()) {
              Object next =  iterator.next();
         }

    11. ittok

       //ittok  生成String token遍历
         for (StringTokenizer stringTokenizer = new StringTokenizer(APP_NAME); stringTokenizer.hasMoreTokens(); ) {
              String s = stringTokenizer.nextToken();
          }

    12. itws  

    复制代码
       //生成Axis2 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();
          }
    复制代码

    13 .try 如:"abc".try

    复制代码
     //生成try.....catch
            try {
                "abc"
            } catch (Exception e) {
              e.printStackTrace();
            }
    复制代码

    14. ifn

    
    
      //生成判断是否为空  
          if (list == null) {
          }

    15. inn

        ///生成判断是否不为空  
         if (list != null) {
         }

    16. fori

        //生成简单for循环
          for (int i = 0; i < ; i++) { 
          }

    17. inst   

     //生成是否是该对象引用
         if (list instanceof Object) {
              Object o = (Object) list; 
         }

    18.psf

       ///生成 共有 静态最终的
         public static final

    19. psfi 

       ///生成 共有 静态最终的 int
         public static final int 

    20.psfs

     ///生成 共有 静态最终的 String
        public static final String 
    © 版权声明 文章版权归作者所有,若需转载,请在显著位置标志该文章地址。
  • 相关阅读:
    Nginx详解(正向代理、反向代理、负载均衡原理)
    java List的初始化
    nginx配置实现负载均衡
    SQL中where与having的区别
    数据库中where与having区别~~~
    group by的使用
    wm_concat函数
    Nginx配置upstream实现负载均衡1
    Nginx配置upstream实现负载均衡
    java
  • 原文地址:https://www.cnblogs.com/luchenglong/p/15423754.html
Copyright © 2020-2023  润新知