09 2019 档案

摘要: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) 编辑
摘要:Java容器类类库的用途是“保存对象”,并将其划分为两个不同的概念: (1)Collection。一个独立元素的序列,这些元素都服从一条或多条规则。List必须按照插入的顺序保存元素,而Set不能有重复元素。Queue按照排队规则来确定对象产生的顺序。 (2)Map。一组成对的“键值对”对象,允许你 阅读全文
posted @ 2019-09-18 17:45 深南大道 阅读(3308) 评论(0) 推荐(2) 编辑
摘要:package com.test3; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; public class demo3 { public static void main(String[] args) { HashMap<String 阅读全文
posted @ 2019-09-18 13:56 深南大道 阅读(175) 评论(0) 推荐(0) 编辑
摘要:package com.test2; public class demo2 { public static void main(String[] args) { /** * 一维数组使用 */ //数组最大的缺陷:长度固定 //int data[] = {10, 20, 30}; /*开辟了一个长度为... 阅读全文
posted @ 2019-09-18 12:05 深南大道 阅读(539) 评论(0) 推荐(0) 编辑
摘要:package com.inter; /** * 继承和接口的关系,单继承,多接口 * java不支持多继承,但可通过接口实现多重继承 */ public class test2 { public static void main(String[] args) { LitterMonkey litterMonkey = new LitterMonkey(); ... 阅读全文
posted @ 2019-09-17 19:11 深南大道 阅读(859) 评论(0) 推荐(0) 编辑
摘要:package com.test1; /** * 接口的使用 */ public class test1 { public static void main(String[] args) { //创建Compute Compute compute = new Compute(); //创建Camera Camera camera = new Camera(); //创建Phone Phone ph 阅读全文
posted @ 2019-09-17 17:50 深南大道 阅读(853) 评论(0) 推荐(0) 编辑
摘要:抽象类: 抽象类就是不能使用new方法进行实例化的类(不能被实例化,可以有多个抽象方法),即没有具体实例对象的类,抽象类有点类似于“模板”的作用,目的是根据其格式来创建和修改新的类,对象不能由抽象类直接创建,只可以通过抽象类派生出新的子类,再由其子类来创建对象,当一个类被声明为抽象类时,要在这个类前 阅读全文
posted @ 2019-09-17 17:07 深南大道 阅读(3364) 评论(0) 推荐(0) 编辑
摘要:package com.qushida.util; import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.sql.Connection; import java.sql.PreparedStatement; import jav... 阅读全文
posted @ 2019-09-17 16:41 深南大道 阅读(1474) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示