易截截图软件、单文件、免安装、纯绿色、仅160KB

[JAVA] 深克隆 另外实现方法【序列化】

private static List cloneObject(
   Object obj) throws Exception {
  ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  ObjectOutputStream out = new ObjectOutputStream(byteOut);
  out.writeObject(obj);
  ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut
    .toByteArray());
  ObjectInputStream in = new ObjectInputStream(byteIn);
  return  in.readObject();
 }


相关文档:

java开发中Mysql中文乱码问题的解决

     Mysql在默认情况下建立表的字符编码是latin1,所以在插入中文时会出错。
eg:
1、查看表建立的sql源码:
1: sql命令:show create table users
2:
3: 结果:
4: CREATE TABLE `users` (
5: `userID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6: `userName` varchar(4 ......

java 继承中的构造方法


参考代码:
class SuperClass {
private int n;

SuperClass() {
System.out.println("SuperClass()");
}

SuperClass(int n) {
System.out.println("SuperClass(" + n + ")");
this.n = n;
}
}
class SubClass extends SuperClass {
private int n ......

java中使用scoket模拟http post请求发送图片或文件

java中使用scoket模拟http post请求发送图片或文件
最近遇到个问题,两个系统共用用户的头像,用户的头像在一个系统中保存,这就涉及到将图片通过scoket发送给另一个系统存储的问题,最初的思路是将图片读成byte[]数组,然后发送,但又发现,发送图片的同时还要发送密钥、uid、username等信息,好通过对方系统的验证,这就 ......

java 中环境变量的设置方法

好久没用java,突一写起来,发现机器上没有设置环境变量,把设置方法总结一下
  1. 修改/etc/profile文件
    如果你的计算机仅仅作为开发使用时推荐使用这种方法,因为所有用户的shell都有权使用这些环境变量,可能会给系统带来安全性问题。
    ·用文本编辑器打开/etc/profile
    ·在pr ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号