PoeticalJustice

导航

上一页 1 ··· 9 10 11 12 13 14 下一页

2017年9月28日 #

Switch

摘要: 1 /** 2 * JDK7.0新特性 7.0以前 表达式的结果只能是int(或者可以自动转成int的 byte short char)枚举类型 3 * 7.0之后 表达式可以是 字符串! 4 * 如果想看效果 就装上7以上的版本 5 */ 6 public class TestSwitch { 7 public static void main(Stri... 阅读全文

posted @ 2017-09-28 21:46 PoeticalJustice 阅读(150) 评论(0) 推荐(0) 编辑

Scanner

摘要: 1 import java.util.Scanner; 2 3 /** 4 * 测试 Scanner类的使用,如何接受键盘的输入. 5 * @author Administrator 6 *@version 1.0 7 */ 8 public class TestScanner { 9 10 public static void test01(){ ... 阅读全文

posted @ 2017-09-28 21:45 PoeticalJustice 阅读(142) 评论(0) 推荐(0) 编辑

Method

摘要: 1 /** 2 * @author Administrator 3 * @version 1.0 4 * 为什么需要方法 ? method 完成特定功能的代码片段 5 * 方便复用 6 * 输入(参数列表)=> 方法 (运算) => 输出(返回值) 7 * JAVA中只要值传递 传递对象 是 对象的引用的传递 8 * 9 * 设计方法 最... 阅读全文

posted @ 2017-09-28 21:44 PoeticalJustice 阅读(140) 评论(0) 推荐(0) 编辑

Recursion递归

摘要: 1 /*java.lang 核心包 如 String Math Integer System Thread等 拿来直接用 2 * java.awt 窗口工具 GUI 3 * java.net 网络包 4 * java.io 输入 输出 5 * java.util 工具类 日期 日历 定义 系统特性 6 * 7 * 8 */ 9 public class... 阅读全文

posted @ 2017-09-28 21:44 PoeticalJustice 阅读(162) 评论(0) 推荐(0) 编辑

if

摘要: 1 // 测试if 2 public class TestIf { 3 public static void main(String[]args){ 4 //[0,1)的随机小数 5 double d =Math.random(); 6 int e= 1+(int)(d*6); 7 System.out.pri... 阅读全文

posted @ 2017-09-28 21:42 PoeticalJustice 阅读(158) 评论(0) 推荐(0) 编辑

for

摘要: 1 public class TestFor { 2 3 /** 4 * 测试for循环; 5 * 加强版for循环 foreach 6 */ 7 public static void main(String[] args) { 8 for(int a=0;a<=100;a++){ 9 ... 阅读全文

posted @ 2017-09-28 21:42 PoeticalJustice 阅读(89) 评论(0) 推荐(0) 编辑

dowhile

摘要: 1 public class TestDoWhile { 2 3 /**do while 至少执行一次 先斩后奏 4 * 测试dowhile 5 */ 6 public static void main(String[] args) { 7 int a=0; 8 while(a<0){ 9 ... 阅读全文

posted @ 2017-09-28 21:41 PoeticalJustice 阅读(215) 评论(0) 推荐(0) 编辑

while

摘要: 1 public class TestWhile { 2 3 /** 4 * 测试循环 5 */ 6 public static void main(String[] args) { 7 int a=1; 8 while(a<=100){ 9 System.out.println(a)... 阅读全文

posted @ 2017-09-28 21:40 PoeticalJustice 阅读(144) 评论(0) 推荐(0) 编辑

DataType 数据类型

摘要: 基本类型:四类八种:数值 : 整数:byte,short,int,long。默认是 int 小数:float,double 默认是 double 布尔:boolean 字符:char 引用类型:数组,对象,接口 阅读全文

posted @ 2017-09-28 21:38 PoeticalJustice 阅读(833) 评论(0) 推荐(0) 编辑

char

摘要: 1 public class TestChar { 2 3 4 public static void main(String[]args){ 5 /* 6 char c1='A'; 7 8 int f=c1+1; 9 char... 阅读全文

posted @ 2017-09-28 21:30 PoeticalJustice 阅读(144) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 下一页