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

Java 操作文本 封装类

package com.sidi.card.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * 用于对文本的操作
 *
 * @author 朱志杰
 *
 */
public class NoteOperate {
    // txt文件路径
    private String filePath;
    /**
     * 构造函数
     *
     * @param filePath
     *            文本文件全路径
     */
    public NoteOperate(String filePath) {
        this.filePath = filePath;
    }
    /**
     * 构造函数
     *
     * @param file
     *            需要读取的文本文件
     */
    public NoteOperate(File file) {
        this.filePath = file.getPath();
    }
    /**
     * 判断文本文件是否存在
     *
     * @return 存在返回true 否则返回false
     */
    public boolean exists() {
        File file = new File(this.filePath);
        return file.exists();
    }
    /**
     * 得到这个txt所有的列的数据 空行将自动跳过,并自动删除文字前后的空格
     *
     * @return List<String>
     * @throws IOException
     */
    public List<String&g


相关文档:

Java代码重复使用

 首先在公共类写好数据库连接和关闭方法:
public static Connection getConnection(){
Connection conn = null;
try {
Context ic = new InitialContext();
DataSource source = (DataSource)ic.lookup("java:comp/env/jdbc/ownHome");
conn = source.getConnection();
} catch (NamingExcepti ......

java读取html文件并抽取a href相关连接和链接标题

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.*;
import java.io.*;
import java.nio.CharBuffer;
public class RegTest
{
    public static void main(String[] args)
    {
        //定义一个文章列 ......

Java适配器

ParserAdapter,MouseInputAdapter....
interface can be added to an existing class or used to create an adapter
方法就是 面向结构语言的:函数
java中适配器的作用实际上是实现了接口的类,但是适配器所实现的只是空方法。因为如果我们不用适配器,直接去实现接口,也要逐个实现里面的方法,并且大多情况下我们 ......

JAVA多态性

一、基本概念
多态性:发送消息给某个对象,让该对象自行决定响应何种行为。
通过将子类对象引用赋值给超类对象引用变量来实现动态方法调用。
java 的这种机制遵循一个原则:当超类对象引用变量引用子类对象时,被引用对象的类型而不是引用变量的类型决定了调用谁的成员方法,但是这个被调用的方法必须是在超类中定义 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号