摘要: 阅读全文
posted @ 2015-10-12 20:25 業&裳 阅读(141) 评论(0) 推荐(0) 编辑
摘要: //加法 int a = 100; int b = 20; System.out.println("a + b = "+ (a + b)); //实例化 new //类名 对象名 = new 构... 阅读全文
posted @ 2015-10-12 20:24 業&裳 阅读(195) 评论(0) 推荐(0) 编辑
摘要: int i = 123; long l = i; int int1 = (int)l;//强制转换,数据之间要有关联,比如数字之间 //包装类 //int int2 = (int)"2";//这是不被允许... 阅读全文
posted @ 2015-10-12 20:22 業&裳 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1、Math库里的static(静态)方法random() 该方法的作用是产生0到1之间(包括0,但不包括1)的一个double值。double rand = Math.random();2、通过Random类的对象 程序可生成许多不同类型的随机数字,做法很简单,只需调用方法nextInt()和... 阅读全文
posted @ 2015-10-12 19:12 業&裳 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 1 for(int i = 1;i = j) 6 { 7 System.out.print(j + " * " + i + " = " +( i * j )+ " "); 8 } 9 ... 阅读全文
posted @ 2015-10-11 19:49 業&裳 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1 //String[] qew = new String[5]; 2 3 char[] csz = new char[5]; 4 csz[0] = 'f';//定义什么类型的就放置什么类型数值 5 6 ... 阅读全文
posted @ 2015-10-09 22:26 業&裳 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1 第一题 2 3 long arr1[] = new long[]{1,2,3,4,5}; 4 5 long arr2[] = Arrays.copyOfRange(arr1, 0, 3); 6 7 ... 阅读全文
posted @ 2015-10-09 22:23 業&裳 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1 //一维数组 2 //数组初始化 3 4 int myarry[] = new int[5];//myarry 数组名 new 关键字 [5] 有五个数0-4,五个数 5 int my[] = new int... 阅读全文
posted @ 2015-10-08 22:08 業&裳 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 for(int i = 0 ;i = i;a--) 4 { 5 System.out.print(" "); 6 } 7 for(int a = 0;a = i;a--)24... 阅读全文
posted @ 2015-10-04 12:55 業&裳 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 //4的阶乘 2 int jc = 4; //定义一个变量用来代表要计算的数值 3 long jd =1; ... 阅读全文
posted @ 2015-10-04 10:53 業&裳 阅读(2217) 评论(0) 推荐(0) 编辑