会员
众包
新闻
博问
闪存
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
流光若影
上一页
1
2
3
4
5
6
下一页
class对象,反射
摘要: 获取Class对象的三种方式: 1.通过getObject() Person p=new Person(); Class c=p.getClass(); 2.通过类名.class获取字节码文件对象 Class c=Person.class 3.通过class类中的方法,将类名传给forName方法
阅读全文
posted @ 2019-10-29 10:15 流光若影
阅读(120)
评论(0)
推荐(0)
编辑
UDP通信,TCP通信
摘要: UDP发送端 UDP接收端 TCP客户端 TCP服务端
阅读全文
posted @ 2019-10-26 15:54 流光若影
阅读(139)
评论(0)
推荐(0)
编辑
线程安全
摘要: 同步代码块,同步方法,Lock接口 Object ojb=new Object(); 同步代码块: synchronized(obj){aaaaa} 同步方法: aaa(); public synchronized void aaa(){aaaaaa} Lock接口方法: private Lock
阅读全文
posted @ 2019-10-26 10:38 流光若影
阅读(138)
评论(0)
推荐(0)
编辑
匿名内部类线程,线程池
摘要: 匿名内部类线程 1.继承Thread方法 //创建线程任务和线程对象 new Thread(){ public void run(){ for(){ sysout(Thread.currentThread.getName()) } } }.start() 2.实现Runnable接口的方法 //创建
阅读全文
posted @ 2019-10-25 11:05 流光若影
阅读(615)
评论(0)
推荐(0)
编辑
多线程:创建线程Thread类和Runnable
摘要: 创建线程方法1,继承Thread类: public class MYThread extends Thread{ //重写run方法 public void run() } //创建线程对象,并开启线程 main(){ MyThread mt=new MyThread(); mt.start() }
阅读全文
posted @ 2019-10-23 16:24 流光若影
阅读(164)
评论(0)
推荐(0)
编辑
properties类和序列化/反序列化
摘要: Hashtable的子类,map的子类,无序,key value值均为string 创建properties集合: Properties prot=new Properties(); 存数据:put prot.put("aa","bb"); 取数据:getProperty prot.getPrope
阅读全文
posted @ 2019-10-22 15:50 流光若影
阅读(268)
评论(0)
推荐(0)
编辑
字节流、字符流、缓冲流
摘要: 字节流: FileInputStream明确数据源,FileOutputStream明确目的地 FileInputStream fis=new FileInputStream("D:\\aaa\\aaa.rar"); FileOutputStream foss=new FileOutputStrea
阅读全文
posted @ 2019-10-21 11:09 流光若影
阅读(112)
评论(0)
推荐(0)
编辑
IO流,file类
摘要: 创建file对象的方法: //创建File对象,需要转译,无法判定路径是否存在 File file=new File("D:\\demo0723\\a.txt");2.路径拼接方法 File file2=new File("D:\\demo0723","a.txt"); System.out.pri
阅读全文
posted @ 2019-10-21 10:34 流光若影
阅读(98)
评论(0)
推荐(0)
编辑
JDBC连库
摘要: 1.注册驱动 2.获取连接对象 3.获取语句执行对象 4.执行sql语句 5.处理返回值 6.释放资源,先开的后关
阅读全文
posted @ 2019-10-09 10:37 流光若影
阅读(112)
评论(0)
推荐(0)
编辑
java的异常
摘要: 异常分编译期异常和运行时异常。 NullPointerException为运行时异常 ArrayIndexOutOfboundsException为运行时异常 解决异常的两种方法:向上传给虚拟机,try catch finally throws Exception: 虚拟机会1.终止程序2.打印异常
阅读全文
posted @ 2019-09-30 10:47 流光若影
阅读(92)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
6
下一页
导航
博客园
首页
联系
订阅
管理
公告