
java
weixin_41069726
这个作者很懒,什么都没留下…
展开
-
java ObjectOutputStream 对象的序列化 Serializable
文档地址 http://tool.oschina.net/apidocs/apidoc?api=jdk-zh序列化 : 把java对象转换成字节序列的过程反序列化: 把字节序列恢复为java对象的过程第一步 新建一个类实现 Serializable 接口 重写toString 方法 public class Goods implements Serializable{p...翻译 2019-01-17 15:26:41 · 858 阅读 · 0 评论 -
java字节字符转换流 InputStreamReader 与OutputStreamWrite的构造方法
构造方法InputStreamReader(InputStream in) 创建一个使用默认字符集的 InputStreamReader。InputStreamReader(InputStream in, Charset cs) 创建使用给定字符集的 InputStreamReader。InputStreamReader(InputStream in, CharsetDecod...原创 2019-01-16 16:58:57 · 463 阅读 · 0 评论 -
java InputStreamReader与OutputStreamWriter的基本用法
文档地址 http://tool.oschina.net/apidocs/apidoc?api=jdk-zhvoid Test(){try {FileInputStream fis = new FileInputStream("/users/yifei/desktop/assets/js.txt");FileOutputStream fos = new FileOutputStre...翻译 2019-01-17 09:09:37 · 193 阅读 · 0 评论 -
java.io.BufferedReader与BufferedWriter 缓冲流中对字符串的操作 上几篇都是对字节的操作
文档地址 http://tool.oschina.net/apidocs/apidoc?api=jdk-zhvoid Test(){ File f = new File("/users/yifei/desktop/assets/ll.txt"); File fc = new File("/users/yifei/desktop/assets/lcopy.txt");InputSt...原创 2019-01-17 09:14:03 · 170 阅读 · 0 评论 -
java ObjectOutputStream 对象的序列化 Serializable
第一步 新建一个类继承Serializable接口public class Goods implements Serializable{private String goodsId;private String goodsName;private double price;public String getGoodsId() {return goodsId;}pub...原创 2019-03-23 11:00:03 · 212 阅读 · 0 评论 -
mac上面查看,关闭进程
查看lsof -i :8080sudolsof -i :8080关闭kill -9 pid转载 2019-05-25 17:57:38 · 1136 阅读 · 0 评论 -
jsp ---1
1jsp的页面元素a脚本 Scriptlet1 <%%> 局部变量 java语句2 <%! %> 定义全局变量3 <%=输出表达式%>二 指令<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-...转载 2019-05-25 18:39:48 · 102 阅读 · 0 评论 -
jsp----2内置对象
jsp内置对象 不需要new1 out 向客户端输出内容2 pageContext 3 request 请求对象 存储客户端向服务端发送请求消息 String request.getParameter(String name) String[]request.getParamterValues(String name) checkBox s...转载 2019-05-25 20:58:02 · 81 阅读 · 0 评论 -
jsp----3response session cookie(不是内置对象)
response 相应对象提供的方法addCookie(Cookie cookie) 服务端向客户端增加cookie对象sendRedirect(String location) throw IOException 页面跳转的一种方式 重定向会导致数据丢失setContentType(String type) 设置服务端的contentType的类型request.getReq...转载 2019-05-26 08:59:08 · 136 阅读 · 0 评论 -
jsp---4application
applicationString getContextPath() 虚拟路径String getRealPath() 绝对路径四种范围对象pageContext jsp页面对象 page对象 当前页面有效,跳转无效requestsessionapplication 全局对象以上4个对象共有的方法setAttribute(String name,O...转载 2019-05-26 14:54:23 · 94 阅读 · 0 评论 -
jsp---4jdbc
java dataBase connectivity 可以为多种关系型数据库JDBC API 提供各种炒作服务接口 Connection Statement PreparedStatement ResultSetJDBC DriverManager 管理不同的数据库驱动各种数据库驱动相应的数据库厂商提供的 (第三放公司提供) 连接/直接操作数据库JDBC APIDr...转载 2019-05-26 15:55:10 · 110 阅读 · 0 评论 -
jsp ---- 第一次数据库连接
public class JDBCDemo { private final static String URL = "jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=GBK"; private final static String USERNAME = "root"; private fin...转载 2019-05-26 22:11:38 · 133 阅读 · 0 评论 -
字节输出流OutputStream
原创 2019-01-16 16:32:47 · 217 阅读 · 0 评论 -
java字节输入流 InputStream
原创 2019-01-16 16:28:30 · 98 阅读 · 0 评论 -
java线程以继承Thread类的方法实现多线程
创建一个类继承Tread 实现run方法class MyThread extends Thread{ public MyThread(String name) { super(name); }@Overridepublic void run() {// TODO Auto-generated method stubfor (int i = 1; i &...转载 2019-01-15 15:22:16 · 389 阅读 · 0 评论 -
java 通过实现runnable接口 实现多线程
1 定义一个类实现 runnable接口class Animal implements Runnable{@Overridepublic void run() { int i =1; for (int j = 0; j < 10; j++) { i++; System.out.println(Thread.currentThread().getName())...原创 2019-01-15 15:31:12 · 559 阅读 · 0 评论 -
java线程休眠 sleep
创建一个实现runnable接口的类并在run方法中调用 Thread.sleep(秒数) ,必须 try/catchclass MyThread implements Runnable{@Overridepublic void run() { for (int i = 1; i <=15; i++) { System.out.println(Thread.currentT...原创 2019-01-15 15:43:25 · 124 阅读 · 0 评论 -
java线程join方法的使用
新建一个实现了Runnable接口的类class JoinThread implements Runnable{@Overridepublic void run() { // TODO Auto-generated method stub for (int i = 1; i < 20; i++) { System.out.println(Thread.currentThread...原创 2019-01-15 16:22:35 · 266 阅读 · 0 评论 -
java线程的优先级
java 线程优先级有10个等级(int 1 ,2,3,4,5,6,7,8,9,10)MAX_PRIORITY=10 最大MIN_PRIORITY=0 最小NORM_PRIORITY = 5; 线程 默认public int getPriority()public void setPriority(int newPriority);定义一个 继承 Thread类的...原创 2019-01-15 16:53:39 · 105 阅读 · 0 评论 -
java文件输入流FileInputStream
文档地址: http://tool.oschina.net/apidocs/apidoc?api=jdk-zh构造方法:1 FileInputStream(File file)2 FileInputStream(String name)方法close() 关闭此文件输入流并释放与此流有关的所有系统资源。read() 从此输入流中读取一个数据字节。read(byte[]...原创 2019-01-16 13:49:21 · 295 阅读 · 0 评论 -
java文件输出流 FileOututStream
文档地址 http://tool.oschina.net/apidocs/apidoc?api=jdk-zh与FileInputStream相对应构造方法FileOutputStream(File file)FileOutputStream(File file, boolean append) 向文档的末尾追加FileOutputStream(FileDescriptor fdObj)...原创 2019-01-16 14:03:26 · 835 阅读 · 0 评论 -
java文件输入与输出流结合FileInputStream与FileOutputStream
void init() throws IOException {String filePath = “…/…/…/desktop/test/1.txt”;FileOutputStream fos = new FileOutputStream(filePath,true);try {byte[] b =new byte[] {99,100,101,102,103,104,105,106,1...原创 2019-01-16 14:37:51 · 407 阅读 · 0 评论 -
java FileInputStream 与FileOutputStream 实现读出写入流, 复制图片
void CopyImage(){try {String filePath ="/users/yifei/desktop/assets/timg.gif";File f = new File(filePath);f.setWritable(true);f.setReadable(true);FileInputStream fis = new FileInputStream(f);Fi...原创 2019-01-16 15:19:49 · 1215 阅读 · 0 评论 -
java缓冲输入输出流 BufferedInputStream BufferedOutputStream
文档地址 http://tool.oschina.net/apidocs/apidoc?api=jdk-zh用FileOutputStream 与BufferedOutputStream 结合用FileInputStream 与BufferedInputStream结合进行读写操作 try {FileOutputStream fos = new FileOutputStr...原创 2019-01-16 15:45:47 · 359 阅读 · 0 评论 -
BufferedInputStream与BufferedOutputStream 实现copy图片
main(String[] args) {try {FileInputStream fis = new FileInputStream("/users/yifei/desktop/assets/timg.gif");BufferedInputStream bis = new BufferedInputStream(fis); FileOutputStream fos = new ...原创 2019-01-16 16:10:57 · 1354 阅读 · 0 评论 -
mybatis---1
1转载 2019-06-02 15:02:55 · 95 阅读 · 0 评论