上一页 1 2 3 4 5 6 ··· 18 下一页
摘要: pom.xml文件配置 阅读全文
posted @ 2019-10-08 15:23 深南大道 阅读(1563) 评论(0) 推荐(0) 编辑
摘要: --新建存储过程 create procedure doinsert3() begin declare i int; declare j int; set i = 0; set j = 0; while(i<=200) do insert into reader_info(name,sex,birth,address,telcode) values(concat('测试',i),'男','1... 阅读全文
posted @ 2019-10-08 12:53 深南大道 阅读(353) 评论(0) 推荐(0) 编辑
摘要: package com.example.redis.controller; import com.example.redis.entity.User; import com.example.redis.util.JedisUtil; import com.example.redis.util.RedisUtil; import org.springframework.beans.factory... 阅读全文
posted @ 2019-10-08 10:15 深南大道 阅读(8537) 评论(1) 推荐(0) 编辑
摘要: package com.example.redisdistlock.util; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.... 阅读全文
posted @ 2019-10-08 10:07 深南大道 阅读(11243) 评论(0) 推荐(0) 编辑
摘要: package demo.dto; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; import java.io.Serializable; public class ProductDto implements Serializable { ... 阅读全文
posted @ 2019-10-05 21:36 深南大道 阅读(6627) 评论(0) 推荐(0) 编辑
摘要: package demo.utils; import com.alibaba.fastjson.JSON; import demo.controller.ProductController; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springfra 阅读全文
posted @ 2019-10-05 21:15 深南大道 阅读(1079) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; public class Test4 { public static void main(String[] args) { PipedInputStream pin = new PipedInputStream 阅读全文
posted @ 2019-10-02 19:22 深南大道 阅读(255) 评论(0) 推荐(0) 编辑
摘要: import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; public class Test4 { public static void main(String[] args) { ... 阅读全文
posted @ 2019-10-02 14:09 深南大道 阅读(11027) 评论(0) 推荐(0) 编辑
摘要: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; public class Test4 { public static void main(String[] args) { FileUtil f = new FileUtil(); System.out.println(f.re 阅读全文
posted @ 2019-10-02 13:31 深南大道 阅读(1993) 评论(0) 推荐(0) 编辑
摘要: import java.text.SimpleDateFormat; import java.util.Date; public class Test4 { public static void main(String[] args) { /** *Math.sqrt()//计算平方根 *Math.cbrt()//计算立方根 *Math.pow(a, b)//计算a的b次方 *Math.max( 阅读全文
posted @ 2019-10-02 13:19 深南大道 阅读(2468) 评论(0) 推荐(0) 编辑
摘要: import java.text.SimpleDateFormat; import java.util.Date; public class Test4 { public static void main(String[] args) { /** * Letter Date or Time Component Presentation Exam... 阅读全文
posted @ 2019-10-02 12:49 深南大道 阅读(324) 评论(0) 推荐(0) 编辑
摘要: /* 集合框架的工具类。 Collections:集合框架的工具类。里面定义的都是静态方法。 Collections和Collection有什么区别? Collection是集合框架中的一个顶层接口,它里面定义了单列集合的共性方法。 它有两个常用的子接口, List:对元素都有定义索引。有序的。可以重复元素。 Set:不可以重复元素。无序。 Collections是集合框架中的一个工具类。该类中的 阅读全文
posted @ 2019-10-01 21:25 深南大道 阅读(7897) 评论(0) 推荐(0) 编辑
摘要: /* Map集合:该集合存储键值对。一对一对往里存。而且要保证键的唯一性。 Map |--Hashtable:底层是哈希表数据结构,不可以存入null键null值。该集合是线程同步的。效率低。基本已废弃 |--HashMap:底层是哈希表数据结构,允许使用 null 值和 null 键,该集合是不同步的。将hashtable替代,.效率高,不保证顺序。 |--TreeMap:底层是二叉树数... 阅读全文
posted @ 2019-10-01 21:01 深南大道 阅读(359) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.Iterator; public class StringSampleDemo { public static void main(String[] args) { ArrayList al = new ArrayList(); al.add(new Student("zhangsan1", 20, "男") 阅读全文
posted @ 2019-09-30 15:38 深南大道 阅读(1940) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.Iterator; public class StringSampleDemo { public static void main(String[] args) { ArrayList al = new ArrayList(); al.add("1"); al.add("2"); al.add("3"); a 阅读全文
posted @ 2019-09-30 13:34 深南大道 阅读(991) 评论(0) 推荐(0) 编辑
摘要: public class StringSampleDemo { public static void main(String[] args) { int[] arr = {1, 2, -20, 20, 6, 7, 90}; int num = arr.length; //经过多少趟排序 for (int k = num - 1; k > 0; k--) { int flag = 0; //每一次比 阅读全文
posted @ 2019-09-30 12:39 深南大道 阅读(205) 评论(0) 推荐(0) 编辑
摘要: public class ProducterConsumerSample { public static void main(String[] args) { Resourse res = new Resourse(); //两个生产者 Producter producter1 = new Producter(res); Producter producter2 = new Producter(r 阅读全文
posted @ 2019-09-29 16:07 深南大道 阅读(946) 评论(0) 推荐(0) 编辑
摘要: public class ThreadNotifySample { public static void main(String[] args) { // Res res = new Res(); // Input input = new Input(res); // Output output = new Output(res); // Thread t1 = new Thread(input) 阅读全文
posted @ 2019-09-29 15:03 深南大道 阅读(303) 评论(0) 推荐(0) 编辑
摘要: public class DeadLockSample { public static void main(String[] args) { DeadLock d1 = new DeadLock(true); DeadLock d2 = new DeadLock(false); d1.start(); d2.start(); } } class Lock { /** * 死锁定义 所谓死锁是指两个 阅读全文
posted @ 2019-09-29 13:52 深南大道 阅读(225) 评论(0) 推荐(0) 编辑
摘要: public class InstanceSampleTest { public static void main(String[] args) { /** 单例设计模式的 饿汉式和懒汉式 * 单例模式,我们首先必须将类在一个虚拟机中只能产生一个对象,因此应该做到以下几步: * a:私有化构造方法,这样在该类的外边就不能用new操作来创建对象,但是在类的内部可以创建该类的对象。 * b:调用该类的 阅读全文
posted @ 2019-09-29 12:41 深南大道 阅读(288) 评论(0) 推荐(0) 编辑
摘要: /** * 多线程案例 两种方式 模拟买票程序(不考虑线程安全问题) */ public class ThreadTest { public static void main(String[] args) { System.out.println(Thread.currentThread().getName() + " main run start"); //方式1 /** * 模拟4个售票窗口售 阅读全文
posted @ 2019-09-28 22:34 深南大道 阅读(1055) 评论(0) 推荐(0) 编辑
摘要: # # pom.xml中添加引用 # <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> # <dependency> # <groupId>mysql</groupId> # <artifactId>mysql-connector-java</artifactId> # <version>8.0.17</v 阅读全文
posted @ 2019-09-24 09:50 深南大道 阅读(9250) 评论(0) 推荐(0) 编辑
摘要: package com.test7; public class test7 { public static void main(String[] args) { Son son = new Son(1000, "张三"); /** * 打印显示 Father的构造函数1000 张三 Son的构造函数1000 张三 */ } } class Father { private int userId; 阅读全文
posted @ 2019-09-19 18:45 深南大道 阅读(5994) 评论(0) 推荐(0) 编辑
摘要: package com.test7; public class test7 { public static void main(String[] args) { /** * 1、equals()比较的是对象的内容(区分字母的大小写格式)是否相等 equals()用于判断值内容 * 2、“==”比较两个对象时,比较的是两个对象的内存地址... 阅读全文
posted @ 2019-09-19 18:33 深南大道 阅读(709) 评论(0) 推荐(0) 编辑
摘要: DELIMITER $$ DROP PROCEDURE IF EXISTS create_calendar $$ CREATE PROCEDURE create_calendar (s_date DATE, e_date DATE) BEGIN -- 生成一个日历表 SET @createSql = 'CREATE TABLE IF NOT EXISTS calendar_custom ( `da 阅读全文
posted @ 2019-09-19 16:55 深南大道 阅读(4730) 评论(0) 推荐(0) 编辑
摘要: package com.test6; public class test5 { public static void main(String[] args) { int[] arr = {1, 2, 31, 4, 5, 6, 7, 88, 9, 11, -1}; float[] arr2 = {1, 2, 31, 4, 5, 6, 7, 88.88f, 9, 11.1f, -1f}; ArrayH 阅读全文
posted @ 2019-09-19 14:31 深南大道 阅读(6931) 评论(0) 推荐(0) 编辑
摘要: package com.test6; import java.io.FileReader; import java.io.IOException; /** * try...catch...finally */ public class test5 { public static void main(String[] args) { FileReader fr = ... 阅读全文
posted @ 2019-09-19 14:05 深南大道 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Ctrl+Shift + Enter,语句完成 “!”,否定完成,输入表达式时按 “!”键 Ctrl+E,最近的文件 Ctrl+Shift+E,最近更改的文件 Shift+Click,可以关闭文件 Ctrl+[ OR ],可以跑到大括号的开头与结尾 Ctrl+F12,可以显示当前文件的结构 Ctrl+F7,可以查询当前元素在当前文件中的引用,然后按 F3 可以选择 Ctrl+N,可以快速打开类 C 阅读全文
posted @ 2019-09-19 11:18 深南大道 阅读(820) 评论(0) 推荐(0) 编辑
摘要: package com.test5; import java.lang.reflect.Field; import java.lang.reflect.Method; /** * Java泛型和反射机制(泛型的好处 代码安全简单,自动装箱拆箱,提高代码的重用率) */ public class test5 { public static void main(String[] args) { Emp 阅读全文
posted @ 2019-09-19 11:15 深南大道 阅读(268) 评论(0) 推荐(0) 编辑
摘要: package com.test4; import java.util.*; /** * JAVA集合ArrayList,Vector,HashMap,HashTable等使用 */ public class test4 { public static void main(String[] args) { //ArrayList异步,线程不安全,性能高 Vect... 阅读全文
posted @ 2019-09-19 09:47 深南大道 阅读(263) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 18 下一页
点击右上角即可分享
微信分享提示