06 2017 档案
EasyUI第一个页面
摘要:EasyUI插件及第一个页面: <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Tra 阅读全文
posted @ 2017-06-09 08:48 两枝梅 阅读(253) 评论(0) 推荐(0)
js入门6数组的倒转与排序
摘要:1、得到文本框中录入的文本; 2、将文本拆分为字符数组; 3、调用Array对象的revert方法实现数组的倒转; 4、调用Array对象的sort方法实现数组的排序(按照文本); 5、调用Array对象的sort方法,并传入自定义的比较函数,对数组实现按数值排序。 //数组操作function o 阅读全文
posted @ 2017-06-07 20:02 两枝梅 阅读(539) 评论(0) 推荐(0)
js入门5-字符的查询与过滤 加上使用正则表达式
摘要:<h2>5.String对象:字符的查找与过滤</h2> <input type="text" id="txtString"/><br/> <input type="button" value="过滤特殊字符(js)" onclick="searchStringAndReplace();"/> // 阅读全文
posted @ 2017-06-07 19:22 两枝梅 阅读(240) 评论(0) 推荐(0)
js入门4-计算阶乘
摘要:<h2>4.控制语句:求阶乘</h2> <input type="button" value="求10的阶乘" onclick="getFac();"/> function getFac(){ var result = 1; for(var i=1;i<=10;i++){ result *=i; } 阅读全文
posted @ 2017-06-07 18:33 两枝梅 阅读(696) 评论(0) 推荐(0)
js入门3-猜数字
摘要:<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3c.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3x. 阅读全文
posted @ 2017-06-07 18:29 两枝梅 阅读(227) 评论(0) 推荐(0)
js入门2计算平方
摘要:数据类型转换函数 toString--转换成字符串;--所有数据类型均可转换成String类型 parseInt--强制转换成整数;如果不能转换则返回NaN parseFloat--强制转换成浮点数,如果不能转换返回NaN <!doctype html public "-//w3c//dtd xht 阅读全文
posted @ 2017-06-07 17:39 两枝梅 阅读(2208) 评论(0) 推荐(0)
js入门1
摘要:html代码: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3c.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http:// 阅读全文
posted @ 2017-06-07 17:26 两枝梅 阅读(132) 评论(0) 推荐(0)
html入门
摘要:<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3c.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3x. 阅读全文
posted @ 2017-06-07 17:10 两枝梅 阅读(135) 评论(0) 推荐(0)
表单的例
摘要:<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en""http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org 阅读全文
posted @ 2017-06-07 14:35 两枝梅 阅读(131) 评论(0) 推荐(0)
sql概述
摘要:数据定义语言DDl: Create:创建表或其他对象的结构。alter修改表。drop删除表。truncate删除表数据保存表结构 数据操纵语言DML: insert将数据插入数据表中。update更新数据表中已存在的数据。delete删除数据表中的数据 数据控制语言TCL事物控制语言: 用来维护数 阅读全文
posted @ 2017-06-05 09:09 两枝梅 阅读(183) 评论(0) 推荐(0)
完成多条Emp信息的XML描述
摘要:一、创建xml文件,首先创建名为EmpList.xml的xml文件,然后在该文件中使用处理指令设置属性version以及属性encoding的值 <?xml version="1.o" encoding="UTF-8"?> 二、确定根元素,xml要求必须有根元素,所谓根元素就是不被其它元素包围,并且 阅读全文
posted @ 2017-06-02 17:57 两枝梅 阅读(382) 评论(0) 推荐(0)
XML基本用法
摘要:XML处理指令 元素和属性 大小写敏感 元素必须有关闭标签 必须有根元素 元素必须正确嵌套 实体引用 CDATA段 SAXReader读取XML文档 Document的getRootElement方法 element方法 elements方法 getName方法 getText方法 attribut 阅读全文
posted @ 2017-06-02 17:06 两枝梅 阅读(142) 评论(0) 推荐(0)
测试守护线程 java -verbose查看jdk安装路径
摘要:测试守护线程,1。使用内部类创建线程的方式创建线程d,该线程实现每隔0.1秒输出字符串“后台线程”。2.设置线程d为守护线程并启动该线程。3.使main线程阻塞5秒,然后输出字符串“main线程结束了”。 一、创建线程,实现每隔0.1秒输出字符串“后台线程”,首先新建类TestDaemonThrea 阅读全文
posted @ 2017-06-02 16:00 两枝梅 阅读(407) 评论(0) 推荐(0)
线程中测试getName方法和getId方法
摘要:测试Thread类的getName方法和getI的方法,1.创建两个线程,输出默认的线程名字和默认的ID。2.创建一个线程,设置线程的名字并输出线程名字和默认ID。 一、获取默认的线程名字和ID,首先,新建类TestThreadNameAndId,在该类的main方法中,创建两个线程t0、t1;接着 阅读全文
posted @ 2017-06-02 15:47 两枝梅 阅读(3653) 评论(0) 推荐(0)
编写一个线程改变窗体的颜色
摘要:编写一个线程改变窗体的颜色,1,使用Runnable创建线程,该线程实现窗体的颜色在黑色和白色之间不断的切换。使用内部类创建线程的方式,实现窗口的颜色在黑色和白色之间不断的切换。 一、创建类TestRunnable,继承自JFrame,并实现Runnable接口。 二、覆盖Runable接口的run 阅读全文
posted @ 2017-06-02 15:14 两枝梅 阅读(1056) 评论(0) 推荐(0)
创建两个线程分别输出1-100
摘要:使用Thread创建两个线程分别输出1-100. //测试线程public class testThread { //测试多线程并发 public static void main(String[] args) { Thread t1 = new MyThread(); Thread t2 = ne 阅读全文
posted @ 2017-06-02 14:55 两枝梅 阅读(562) 评论(0) 推荐(0)
输出一个目录中的内容
摘要:@Test public void testFile(){ File dir = new File("."); File[] subs = dir.listFiles(); for(File sub:subs){ System.out.println(sub); } } 阅读全文
posted @ 2017-06-02 10:52 两枝梅 阅读(140) 评论(0) 推荐(0)
file占用字节
摘要:@Test public void testFile(){ File file = new File("demo"+File.separator+"Hello.txt"); System.out.println(file+"占用字节"+file.length()); } 阅读全文
posted @ 2017-06-02 10:29 两枝梅 阅读(147) 评论(0) 推荐(0)
MAP集合选出最大值
摘要:import java.util.Arrays;import java.util.HashMap;import java.util.Map;import org.junit.Test;public class TestHashMap { //统计各空气质量的最高值 @Test public void 阅读全文
posted @ 2017-06-02 10:07 两枝梅 阅读(2385) 评论(0) 推荐(0)
使用增强for循环遍历集合
摘要:@Test public void test(){ Collection<String> c = new HashSet<String>(); c.add("java"); c.add("php"); c.add("cpp"); c.add("c#"); for(String str:c){ Sys 阅读全文
posted @ 2017-06-01 20:32 两枝梅 阅读(869) 评论(0) 推荐(0)
使用Iterator的remove方法移除元素
摘要:@Test public void testRemove(){ Collection<String> c = new HashSet<String>(); c.add("java"); c.add("php"); c.add("cpp"); c.add("c#"); Iterator<String> 阅读全文
posted @ 2017-06-01 20:30 两枝梅 阅读(1930) 评论(0) 推荐(0)
使用Iterator的hasNext方法,next方法遍历集合
摘要:@Test public void testIte(){ Collection<String> c = new HashSet<String>(); c.add("java"); c.add("php"); c.add("cpp"); c.add("c#"); Iterator<String> it 阅读全文
posted @ 2017-06-01 20:27 两枝梅 阅读(1358) 评论(0) 推荐(0)
测试方法addAll、containsAll的用法
摘要:import java.util.ArrayList;import java.util.Collection;import java.util.HashSet;import org.junit.Test;public class TestCollection { @Test public void 阅读全文
posted @ 2017-06-01 20:22 两枝梅 阅读(1519) 评论(0) 推荐(0)
使用format方法格式化日期
摘要:@Test public void testFormat(){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss"); Date date = new Date(); String dataStr = sdf.forma 阅读全文
posted @ 2017-06-01 20:15 两枝梅 阅读(709) 评论(0) 推荐(0)
使用setTime和getTime方法操作时间毫秒
摘要:使用setTime和getTime方法操作毫秒表示的日期-时间,获取1970年1月1日零时据当前时刻的毫秒数。获取明天此时此刻的日期-时间 @Test public void testGetTime(){ Date date = new Date(); System.out.println(date 阅读全文
posted @ 2017-06-01 18:23 两枝梅 阅读(2540) 评论(0) 推荐(0)
使用replaceAll实现字符串替换
摘要:使用replaceAll实现字符串替换,具体要求为将字符串“abc123bcd45ef6g7890”中的数字替换成汉字“数字”,如果是连续的数字那么替换为一个汉字“数字”。 在Java api中的String类提供了replaceAll方法,实现将字符串中匹配正则表达式的字符串替换成其它字符串,re 阅读全文
posted @ 2017-06-01 16:58 两枝梅 阅读(6139) 评论(0) 推荐(0)
Split拆分
摘要:@Test public void testSplit(){ //按空格拆分 String str = "java ee php c#"; String[] strArr = str.split("\\s"); System.out.println(Arrays.toString(strArr)); 阅读全文
posted @ 2017-06-01 16:47 两枝梅 阅读(191) 评论(0) 推荐(0)
编写验证email的正则表达式
摘要:public void main(){ String emailRegEx = "^[a-zA-Z0-9_\\.-]+@([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9]{2,4}$"; String email = "bieg@qef.com"; System.out.println(e 阅读全文
posted @ 2017-06-01 16:39 两枝梅 阅读(1553) 评论(0) 推荐(0)
junit测试类的使用
摘要:选择项目添加jar包,导入包 import org.junit.Test; import org.junit.Test;public class TestString { @Test public void testConstantPool(){ String str1 = "Hello"; //不 阅读全文
posted @ 2017-06-01 15:03 两枝梅 阅读(162) 评论(0) 推荐(0)
字符串基本操作
摘要:字符串基本操作 阅读全文
posted @ 2017-06-01 14:52 两枝梅 阅读(87) 评论(0) 推荐(0)
银行取款、查询余额、交电话费功能
摘要:主函数测试方法: public class TestATM { public static void main(String[] args) { ABCATM a = new ABCATM(); //ICBCImpl icbc = new ICBCImpl(3000, "123456");//工商卡 阅读全文
posted @ 2017-06-01 13:42 两枝梅 阅读(249) 评论(0) 推荐(0)
银行卡系统,输入密码取钱功能
摘要:UnionPay接口:用于描述银联统一指定的规则 public interface UnionPay { /* * 接口:用于描述银联统一指定的规则 */ public double getBalance();//查看余额 public boolean drawMoney(double number 阅读全文
posted @ 2017-06-01 11:00 两枝梅 阅读(506) 评论(0) 推荐(0)
根据周长计算不同形状图形的面积
摘要:抽象类:Shape public abstract class Shape { protected double c; public abstract double area();} 类Square正方形,继承抽象类 public class Square extends Shape{ public 阅读全文
posted @ 2017-06-01 09:56 两枝梅 阅读(529) 评论(0) 推荐(0)