Java读取文件的简单代码
网址: http://blog.csdn.net/justinavril/archive/2008/08/06/2775767.aspx
import
java.io.*;
public
class
FileToString {
public
static
String readFile(String fileName) {
String output = ""
;
File file = new
File(fileName);
if
(file.exists()){
if
(file.isFile()){
try
{
BufferedReader input = new
BufferedReader (
new
FileReader(file));
StringBuffer buffer = new
StringBuffer();
String text;
while
((text = input.readLine()) !=
null
)
&n
相关文档:
在目前的关于java自学的讨论中,最经常看到的就是钻研《Thinking in java》(TIJ)的经验,但是,尽管使用TIJ作为教学材料的教学行为也很多,我却尚未发现有从教师关于如何将TIJ用于教学的论述。为此,我权作抛砖引玉。
首先,为什么要学习java?按照Eckel的话说, ......
keytool -genkey -dname "CN=demo, OU=softDept, O=company,
L=puddong,S=shanghai, C=cn" -alias demo -keyalg RSA -keysize 1024
-keystore demoKeystore -validity 3650 -storepass storePwd -keypass
demoPwd
生成保存公钥和私钥的密钥仓库,保存在demoKeystore文件中。这里storepass ......
import java.io.*;
public class FileReaderSample {
public static void main(String args[]) throws IOException
{
// 建立可容纳1024个字符的数组
char data[]=new char[1024];
// 建立对象fr
FileReader fr= ......
import java.io.*;
public class FileWrite {
public static void main(String args[]) {
String outPut = "C:\\bin";
StringBuffer ab = new StringBuffer();
for(int i=6;i<=30;i++){
ab.append("http://www.test.com/joke/index_"+i+".htm\r\n&qu ......