4. An airline java title

Package com.company.suanfa; 

Import of java.util.ArrayList;
 Import java.util.List; 

public  class MouMouHangKong {
     public  static  void main (String [] args) { 
        String STR = "(,, '• • [omega]) Techno" ( 'っω • `.) aviation";
         System.out.println (str); 
        List <String> List = new new ArrayList <String> (); 
        list.add ( "Welcome" ); 
        changeList (List); 
    } 

    / ** 
     * this involves an abnormal 
     * Lisi the size is 1, but is provided for len 2, it will array subscript bounds exception 
     methods it enters the catch *  
     * Finally, the finally
     * @param list
     */
    private static void changeList(List<String> list) {
        int len=2;
        int i=0;
        try {
            for (; i <len ; i++) {
                list.set(i,"欢迎您的到来");
            }
        }catch (Exception e){
            list.add("HVC HO");
            System.out.println("经营理念");
        }finally {
            System.out.println("Century-old" );
            list.add ( "high-value airline" ); 
        } 

    } 

    / ** 
     * Method very dog 
     scope of the problem * variable 
     * @param str
      * / 
    Private  static  void changeStr (String str) { 
         str + = "century-old" ; 
    } 
} 
output 
(,, '• ω •) Techno "('っω •`.) aviation
 business philosophy 
hundred years old

At that time did not do it, did not eat in the morning, hungry, faint lesson: next time remember to eat breakfast in the morning interview

Guess you like

Origin www.cnblogs.com/xnuuuu/p/12163610.html