class shun { shun(char ch) { int i = ch; System.out.println(i); } shun(float d,float e){ if (d>e){ System.out.println(e); }else { System.out.println(d); } } shun(int a, int b, int c) { System.out.println(a*b*c); } } public class text4 { public static void main(String[] args){ shun x=new shun('A'); shun y=new shun(5.45f,6.23f); shun z=new shun(5,4,3); } }
定义一个类,为该类定义三个构造函数,分别执行以下操作:1传递一个char型的字符并输出其Unicode编码值,2传递两个float型的数并输出其中较小的数;3传递三个int型的数并输乘积数值
最新推荐文章于 2023-08-22 15:45:14 发布