PoeticalJustice

导航

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

2017年9月28日 #

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 阅读(149) 评论(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 阅读(153) 评论(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 阅读(169) 评论(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 阅读(162) 评论(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 阅读(95) 评论(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 阅读(219) 评论(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 阅读(150) 评论(0) 推荐(0)

DataType 数据类型

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

posted @ 2017-09-28 21:38 PoeticalJustice 阅读(861) 评论(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 阅读(155) 评论(0) 推荐(0)

Constructor构造方法

摘要: 我们写一个car类,并写一个无参构造方法。 我们来创建一个对象car 写个main方法,看下效果。 控制台打印 构造器不能被继承 只能被调用 所以不存在overwrite 但可以overload 阅读全文

posted @ 2017-09-28 21:28 PoeticalJustice 阅读(305) 评论(0) 推荐(0)

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