SYX
suyixiang · 共 3 篇文章
用文件类实现复制功能(并用正则表达式替换里面值)
/* * couter:苏奕祥 * 实现两个文件的复制功能并且用到正则表达式替换复制完后的值 * */ import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CopyFile { public static void main(String[] args)throws IOException{ File f=new File("E:\\sdx.txt"); File f2=new File("E:\\sdxcopy.txt"); Writer copy=ne…
2012-12-21 11:04 · JAVA基础 · 评论(1)
利用多线程实现求不同范围的素数功能
class sushu{ //定义求素数类 public static void tart(int m,int n){ //实现求素数方法函数 tip1:for(int i=m; i<n;i++){ tip2:for(int j=2;j<i;j++){ if(i%j==0){ continue tip1; } else {continue tip2;} } System.out.println(i+""); } } } class TestThread extends Thread{ String name; public TestThread(String name){ this.name…
2012-12-21 10:56 · JAVA基础 · 评论(0)
用文件类实现复制功能
/* * couter:苏奕祥 * 实现两个文件的复制功能并且用到正则表达式替换复制完后的值 * */ import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CopyFile { public static void main(String[] args) throws IOException{ File f=new File( "E:\\sdx.txt" ); File f2=new File( "E:\\sdxcopy.txt" ); Writer co…
2012-12-21 10:52 · JAVA基础 · 评论(0)