java按行读取文件 java依次读取对话框的数据( 二 )


例子
package io;import java.nio.file.*;;public class ReadTextAsString {public static String readFileAsString(String fileName)throws Exception{String data = https://www.fajihao.com/"\";data = https://www.fajihao.com/i/new String(Files.readAllBytes(Paths.get(fileName)));return data;}public static void main(String[] args) throws Exception{String data = readFileAsString(/"C:\\\\Users\\\\pankaj\\\\Desktop\\\\test.java\");System.out.println(data);}}【java按行读取文件 java依次读取对话框的数据】如果本文对你有帮助,别忘记给我个3连  , 点赞,转发,评论,