- 博客(3)
- 收藏
- 关注
原创 2021-01-15
Java实现验证码登录验证功能,简单易懂 验证码工具类, package com.hui.he; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOExcepti
2021-01-15 20:06:52 90 1
原创 单例模式
单例模式 一个类只能创建一个对象:需要在这个类里 定义一个静态的这个类对象属性,获取对象通过类调用属性,构造方法私有化,在本类中创建对象,赋给属性, 代码实现: //饿汉模式,适合多线程程序 public class Student { private static final Student student=new Student(); private Student(){ } public static Student getStudent() { re
2020-12-19 17:47:55 102 1
原创 序列化流和反序列化流的使用
序列化流 只有序列化字节流,参数也只能是字节流 对象的序列化:将对象转为字节码表示。 对象的反序列化:将字节码转为对象。 序列化流 :ObjectOutputStream void writeObject(Object o); 将指定对象写入文件 Student s1=new Student("王",18); //序列化 FileOutputStream f2=new FileOutputStream("dui.txt"); ObjectOutputStream f4=new
2020-12-19 17:18:58 1593 6
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人