摘要: 自定义类要添加到TreeSet中比需实现comparable接口, 重写compareTo()方法。可以使用内部比较器 阅读全文
posted @ 2018-05-15 09:02 马鞍山 阅读(191) 评论(0) 推荐(0) 编辑
摘要: public class StrABCD { static String ss = "ABCD"; public static void main(String[] args) { String s1 = "ABCD"; String s2 = "A"+"B"+"C"+"D"; ... 阅读全文
posted @ 2018-05-13 20:53 马鞍山 阅读(455) 评论(0) 推荐(0) 编辑
摘要: 煮酒论语言 -- 曹孟德黑尽天下语言操:玄德久历四方,必知当世英雄,请试为操言之备:C语言,万言之父,贴近底层,运行高效,Linux都是它做的,可谓英雄?操:C语言,老古董,面向过程,写个东西老半天,何足英雄备:C++,继承大统,面向对象,上写应用,下写系统,撑起IT半边天,可谓英雄?操:C++,不 阅读全文
posted @ 2018-05-13 20:16 马鞍山 阅读(317) 评论(0) 推荐(0) 编辑
摘要: import java.util.LinkedList; /** * @function : 使用Linkedlist 模拟栈 * @author lsh * */ class Stack{ LinkedList linkedList; public Stack() { linkedList = new LinkedList(); } ... 阅读全文
posted @ 2018-05-12 19:24 马鞍山 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 核心:重写equalse()方法! 阅读全文
posted @ 2018-05-12 17:26 马鞍山 阅读(510) 评论(0) 推荐(0) 编辑
摘要: mport java.util.ArrayList; import java.util.List; import java.util.ListIterator; public class RemoveElementArrayLilst { /** * 功能:数组去重复 * @param list 传递一个集合 * @return 返回一个没有重... 阅读全文
posted @ 2018-05-12 17:22 马鞍山 阅读(659) 评论(0) 推荐(0) 编辑
摘要: import java.io.File; public class DeepDeletFile { public static void main(String[] args) { String filePath = "F:\\A"; File file = new File(filePath); ... 阅读全文
posted @ 2018-05-10 21:27 马鞍山 阅读(129) 评论(0) 推荐(0) 编辑
摘要: import java.io.File; public class Rename { public static void main(String[] args) { //文件路径 String filePath = "F:\\JAVA\\"; reName(filePath); } static bo... 阅读全文
posted @ 2018-05-10 20:12 马鞍山 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 欢迎拍砖。。。。。。。。。。。。。。 阅读全文
posted @ 2018-05-09 14:06 马鞍山 阅读(1143) 评论(0) 推荐(0) 编辑
摘要: 开始比较: 比较结果: this.age:17 19-1 欢迎拍砖。。。。。。。。。。。。。。。。。。。。。。。。。。 阅读全文
posted @ 2018-05-06 12:09 马鞍山 阅读(419) 评论(0) 推荐(0) 编辑
摘要: 动物类 : 动物的子类啊猫和啊狗 食物类: 食物类的子类猫粮狗粮 主人类: 测试: 测试结果: 小狗汪汪叫...猫咪 喵喵喵叫... 小狗喜欢吃......骨头小猫喜欢吃......鱼 总结: 多态:多种形态,代码灵活,精髓在于高度管理。中央集权制。 java中允许父类的引用变量引用它的子类的实例, 阅读全文
posted @ 2018-05-06 10:43 马鞍山 阅读(275) 评论(0) 推荐(0) 编辑
摘要: public class Car { private String name; FDJ fdj; WK wk; public Car(FDJ fdj, WK wk) { this.fdj = fdj; this.wk = wk; } } class FDJ{ String name; ... 阅读全文
posted @ 2018-05-05 22:32 马鞍山 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 表演类: 表演结果: 我是剑圣,我的攻击动作:用无极之剑穿刺我是蛮三刀,我的攻击动作:用刀砍...只用三刀我是赵信,我的攻击动作:用长枪捅...专捅菊花 阅读全文
posted @ 2018-05-05 20:50 马鞍山 阅读(110) 评论(0) 推荐(0) 编辑
摘要: * 100个 乐器类对象 实际来源于 100个子类 * 发一个相同的指令 演奏 * 结果: 100个声音 * 1个乐手 演奏多种乐器 一父类 乐器类:和子类 具体的乐器 来个乐手演奏家类 最后进行演奏测试: 演奏效果: 命运交响曲...笑傲江湖...广陵散...命运交响曲...笑傲江湖...广陵散. 阅读全文
posted @ 2018-05-05 20:18 马鞍山 阅读(367) 评论(0) 推荐(0) 编辑
摘要: int i = 12345; String s = String.valueOf(i); String s1 = Integer.toString(i); //最容易的 String s2 = i + ""; System.out.println(s.length()); 阅读全文
posted @ 2018-05-03 14:05 马鞍山 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 冒泡核心思想:相邻元素进行比较(array[i] 和 array[ i + 1 ]),循环一次出来一个最大值(最小值) 阅读全文
posted @ 2018-04-29 10:03 马鞍山 阅读(752) 评论(0) 推荐(0) 编辑
摘要: 掌握核心思想:你就能写出来,核心思想:从头到尾比较一遍,找出最大值(最小值) 阅读全文
posted @ 2018-04-29 09:57 马鞍山 阅读(290) 评论(0) 推荐(0) 编辑
摘要: /** * * @author lsh * * 西游记 猪八戒 vs 蜘蛛精 猪八戒问老大 你多大? 老大说 我比老二大两岁 猪八戒问老二 你多大? 老二说 我比老三大两岁 猪八戒问老三 你多大? 老三说 我比老四大两岁 ..... 猪八戒问老七 ... 阅读全文
posted @ 2018-04-27 20:05 马鞍山 阅读(545) 评论(0) 推荐(0) 编辑
摘要: public class Sort4 { public static void main(String[] args) { int x = 9; int y = 2; int z = 1; int temp = 0; if(x > y) { temp... 阅读全文
posted @ 2018-04-26 20:12 马鞍山 阅读(108) 评论(0) 推荐(0) 编辑
摘要: <!--[if !supportLists]-->1.1.7 只有非private的static成员才能通过类名的 方式访问。 <!--[if !supportLists]-->1.1.8 非静态方法可以访问静态成员、非静态方法。 <!--[if !supportLists]-->1.1.9 静态方 阅读全文
posted @ 2018-04-25 15:23 马鞍山 阅读(789) 评论(0) 推荐(0) 编辑
摘要: public class _01Celebrity{ //属性 public String name; public int age; public double height; public char gender; //构造器 public _01Celebrity(String name,int age,double he... 阅读全文
posted @ 2018-04-25 08:43 马鞍山 阅读(253) 评论(0) 推荐(0) 编辑
摘要: import java.util.Calendar; public class _String { public static void main(String[] args) { char[] original = {'赵','兄','托','你','帮','我','办','点','事','好','不','好','?'}; System.o... 阅读全文
posted @ 2018-04-24 22:51 马鞍山 阅读(365) 评论(0) 推荐(0) 编辑
摘要: public class Sort3 { public static void main(String[] args) { int x = 1; int y = 4; int z = 2; int max = x > y ? (x > z ? x : z) : (y > z ? y : z); ... 阅读全文
posted @ 2018-04-24 20:28 马鞍山 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 英雄信息: >>>>>>英雄姓名:无极剑圣>>>>>>英雄血量:430>>>>>>英雄护甲:17>>>>>>移动速度:1.56 英雄 die: 阅读全文
posted @ 2018-04-23 22:34 马鞍山 阅读(1886) 评论(0) 推荐(0) 编辑
摘要: public class Sorting{ public static void main(String[] args) { int a = 3; int b = 11 ; int c = 9; //求最大值 int max = (a > b)&& (a > c) ? a : ((b > c) ? b : ... 阅读全文
posted @ 2018-04-23 19:45 马鞍山 阅读(5661) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class SubtractionQuiz { public static void main(String[] args) { String need = "小学生练习减法运算"; String step = "随机产生两个随机数," + "进行显示这两个... 阅读全文
posted @ 2018-04-23 17:35 马鞍山 阅读(240) 评论(0) 推荐(0) 编辑
摘要: public class RandomInt { public static void main(String[] args) { //12生肖 String[] years = new String[12]; //从猴开始 years[0] = "monkery"; years[1] = "roo... 阅读全文
posted @ 2018-04-23 17:32 马鞍山 阅读(668) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-04-18 15:22 马鞍山 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-04-10 14:58 马鞍山 阅读(3093) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-04-10 14:53 马鞍山 阅读(283) 评论(0) 推荐(0) 编辑
摘要: public class _03arrayPratice { public static String join(String[] hero){ String str = "["; int heroLength = hero.length; for(int i = 0; i < heroLength -1 ... 阅读全文
posted @ 2018-04-08 18:00 马鞍山 阅读(121) 评论(0) 推荐(0) 编辑
摘要: java数组转为字符串 封装一个函数方便调用: 阅读全文
posted @ 2018-04-08 17:25 马鞍山 阅读(184) 评论(0) 推荐(0) 编辑
摘要: java关键字break和continue的标签使用,break默认还是跳出当前循环,continue默认还是结束当次循环,如果加上标签就变了,跳到对应标签的地方。 质数的两种求法: 第一种: 第二种: 阅读全文
posted @ 2018-04-03 18:15 马鞍山 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-04-01 23:30 马鞍山 阅读(467) 评论(0) 推荐(0) 编辑
摘要: def go(i): if 0 == i: return else: print("递归_head", i - 1) go(i - 1) print("递归_foot",i - 1) go(3) # 结果 # 递归_head 2 # 递归_head 1 # 递归_head 0 # 递归_foot 0 # 递归_foo... 阅读全文
posted @ 2018-04-01 12:38 马鞍山 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 在统一下单前需要数据签名和获取用户id详情可参看另外两篇文章 http://www.cnblogs.com/itBulls/articles/8645619.html http://www.cnblogs.com/itBulls/articles/8646375.html 统一下单接口 index. 阅读全文
posted @ 2018-03-25 23:05 马鞍山 阅读(3522) 评论(0) 推荐(0) 编辑
摘要: 获取openID 步骤: 第一步请求微信服务器获取code 第二部 代上code 去请求微信服务器获取openID 注意:具体秘钥需要自己填写真实的秘钥,在微信中打开测试! index.php 文件代码 base.php 文件代码 阅读全文
posted @ 2018-03-25 20:04 马鞍山 阅读(2393) 评论(0) 推荐(0) 编辑
摘要: 入口文件index.php代码 Base.php 文件代码 阅读全文
posted @ 2018-03-25 17:33 马鞍山 阅读(6293) 评论(1) 推荐(0) 编辑
摘要: 鸡兔同笼 阅读全文
posted @ 2018-02-19 23:57 马鞍山 阅读(6146) 评论(0) 推荐(0) 编辑
摘要: 1 #3x+4y = 100 求 x = ? ,y = ? 2 3 x = 0 4 while x <= (100//3): 5 if(100 - 3*x) % 4 == 0: 6 y = (100 - 3*x) // 4 7 print("共有解:x的值是 %d,y的值是 %d"%(x,y)) 8 x +=1 9 10 # ... 阅读全文
posted @ 2018-02-19 17:34 马鞍山 阅读(2218) 评论(0) 推荐(0) 编辑