0923-----homework-----about exceptions, print abc by lambda and default function

  1 package com.kai.li.HomeWork0923;
  2 
  3 /**
  4   *work class for all the class
  5   */
  6 public class HomeWork0923{
  7 
  8     /**
  9       *main fuction for all the text
 10       */
 11     public static void main(String[] args){    
 12         //questions of part 1 
 13         for(int i=0;i<4;i++){
 14             int  k;
 15             switch(i){
 16                 case 0:
 17                     try{
 18                         int zero=0;
 19                         k=911/zero;
 20                         break;
 21                     }catch(ArithmeticException e){
 22                         System.out.println(e.getMessage());
 23                     }catch(Exception e){
 24                         e.printStackTrace();
 25                         System.out.println(e.getMessage());
 26                     }
 27                 case 1:
 28                     try{
 29                         int[] b=null;
 30                         k = b[0];
 31                         break;
 32                     }catch(NullPointerException e){
 33                         System.out.println(e.getMessage());
 34                     }catch(Exception e){
 35                         e.printStackTrace();
 36                         System.out.println(e.getMessage());
 37                     }
 38                 case 2:
 39                     try{
 40                         int c[]=new int[2];
 41                         k = c[9];
 42                         break;
 43                     }catch(ArrayIndexOutOfBoundsException e){
 44                         System.out.println(e.getMessage());
 45                     }catch(Exception e){
 46                         e.printStackTrace();
 47                         System.out.println(e.getMessage());
 48                     }
 49                 case 3: 
 50                     try{
 51                         char ch = "abc".charAt(99);
 52                         break;
 53                     }catch(StringIndexOutOfBoundsException e){
 54                         System.out.println(e.getMessage());
 55                     }catch(Exception e){
 56                         e.printStackTrace();
 57                         System.out.println(e.getMessage());
 58                     }
 59             }
 60         }
 61         //questions of part 2
 62         Bank bank=new Bank(100);
 63         try{
 64             bank.withDrawal(150);
 65         }catch(InsufficientFundsException e){
 66             e.printStackTrace();
 67         }catch(NagativeFundsException e){
 68             e.printStackTrace();
 69         }
 70         bank=new Bank(100);
 71         try{
 72             bank.withDrawal(-15);
 73         }catch(NagativeFundsException e){
 74             e.printStackTrace();
 75         }catch(InsufficientFundsException e){
 76             e.printStackTrace();
 77         }
 78         //questions of part 3
 79         InterfaceX ix=()->{};
 80         ix.forl('a',26);
 81         ix.forl('A',26);    
 82     }
 83 }
 84 /**
 85   *this example is texted of exception
 86   */
 87 //define the class bank ,it has some functions with text
 88 class Bank{
 89     private double balance;
 90     Bank(){
 91         this.balance=0;
 92     }
 93     Bank(double balance){
 94         this.balance=balance;    
 95     }
 96     public double getBalance(){
 97         return this.balance;
 98     }
 99     public void withDrawal(double dAmount) throws InsufficientFundsException,NagativeFundsException{
100         if(balance<dAmount)
101             throw new InsufficientFundsException();
102         if(dAmount<0)
103             throw new NagativeFundsException();
104         this.balance-=dAmount;
105     }
106 }
107 //define the first exception by self
108 class InsufficientFundsException extends Exception{
109     @Override
110     public void printStackTrace(){
111         super.printStackTrace();
112         System.out.println("------------");
113     }
114 }
115 //define the seconde exception by self 
116 class NagativeFundsException extends Exception{
117     @Override
118     public void printStackTrace(){
119         super.printStackTrace();
120         System.out.println("||||||||||||");
121     }
122 }
123 /**
124   *define a function interface
125   *it is created for the lembda
126   */
127 @FunctionalInterface
128 interface InterfaceX{
129     void printLetter();
130     default public void forl(int a,int b){
131         for(int i=a;i<a+b;i++){
132             System.out.print((char)i+" ");
133         }
134         System.out.println();    
135     }
136 }

 

转载于:https://www.cnblogs.com/kaililikai/p/5901549.html

内容概要:本报告探讨了AI赋能汽车行业智能化转型的技术创新,涵盖了研发设计智能化、用户运营智能化和座舱体验智能化三大核心场景。通过解析智己汽车的实践,展示了AI在压缩研发周期、提升销售转化率和优化座舱体验等方面的实际价值。报告指出,AI技术正深刻改变汽车产业的价值链,推动从“机械制造”向“移动智能体”的转变,并提出了未来汽车行业智能化的发展趋势,包括更个性化的用户体验、跨产业融合以及数据安全和隐私保护的重要性。 适合人群:汽车行业从业者、技术研发人员、市场营销人员、政策制定者及相关领域的研究者。 使用场景及目标:①理解AI技术在汽车研发设计中的应用,如生成式设计、仿真优化和智能测试;②掌握AI在用户运营中的应用,如智能内容生成、销售辅助和数据闭环优化;③了解AI在座舱体验中的应用,如多意图服务编排、情感计算和端到端语音链路优化;④探讨未来汽车行业智能化的发展方向,包括个性化服务、产业融合和数据安全。 其他说明:本报告不仅提供了理论和技术层面的分析,还结合了具体的落地实践案例,为企业在智能化转型过程中提供了可复用的AI赋能框架。报告强调了政策支持、技术创新和产业协同在推动汽车行业智能化转型中的重要作用,旨在为行业提供有价值的参考和指导。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值