摘要: package xinhuiji_day07;import java.io.File;import java.io.IOException;public class FileTest { /** * @param args */ public static void main(String[] ... 阅读全文
posted @ 2014-07-18 09:06 siashan 阅读(195) 评论(0) 推荐(0) 编辑
摘要: package lianxi;public class StaticTest { int a = 0; static int b =0; StaticTest(){ a++; b++;// } /** * @param args */ public static void main(Stri... 阅读全文
posted @ 2014-07-16 17:49 siashan 阅读(314) 评论(0) 推荐(0) 编辑
摘要: public class TestThis { private String name; void eat(String name){ //String food;//局部变量在使用时必须初始化,否则会报错 error String food = "apple"; //right Syste... 阅读全文
posted @ 2014-07-16 09:14 siashan 阅读(94) 评论(0) 推荐(0) 编辑
摘要: public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub /* * A 父类 * B 子类 * */ ... 阅读全文
posted @ 2014-07-16 09:13 siashan 阅读(281) 评论(0) 推荐(0) 编辑
摘要: package lianxi;public class Test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //功能需求 求一个100... 阅读全文
posted @ 2014-07-15 08:33 siashan 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 定义:Java程序中的各个java类属于同一类事物,描述这类事物的java类就是Class 对比提问:众多的人用一个什么类表示?众多的java类用一个什么类表示? 人 Person Java类 Class 对比提问:Person类代表人,它的实例对象就是张三,李四这样一个个具体的人,Class类对... 阅读全文
posted @ 2014-07-13 12:07 siashan 阅读(136) 评论(0) 推荐(0) 编辑
摘要: package cn.itcast.day2;public class ReflectTest { public static void main(String[] args) throws Exception { String str1 = "abc"; Class cls1 = str1.g... 阅读全文
posted @ 2014-07-13 12:04 siashan 阅读(128) 评论(0) 推荐(0) 编辑
摘要: package cn.itcast.day1;public class Enum { public static void main(String[] args) { Weekday1 weekday = Weekday1.SAT; System.out.println(weekday.ne... 阅读全文
posted @ 2014-07-12 21:48 siashan 阅读(294) 评论(0) 推荐(0) 编辑
摘要: package cn.itcast.day1;public class Weekday0 { private Weekday0(){} public static final Weekday0 SUN = new Weekday0(); public static final Weekday0 MO... 阅读全文
posted @ 2014-07-12 21:18 siashan 阅读(366) 评论(0) 推荐(0) 编辑
摘要: /*String类适用于描述字符串事物最常见的对字符串的操作1, 获取1 字符串中包含的字符个数,就是字符串的长度int length();获取长度2 根据位置获取某个位置上的字符char charAt(int index);3 根据字符获取该字符在字符串中的位置int indexOf(int ch);返回ch在字符串中第一次出现的位置int indexOf(int ch,int fromIndex);从fromIndex位置开始获取ch在字符串中第一次出现的位置int indexOf(String str);返回的是str在字符串中第一次出现的位置int indexOf(str str,in 阅读全文
posted @ 2013-10-26 14:20 siashan 阅读(210) 评论(0) 推荐(0) 编辑