<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </ti…
public long getLineNumber(File file) { if (file.exists()) { try { FileReader fileReader = new FileReader(file); LineNumberReader lineNumberReader = new LineNumberReader(fileReader); lineNumberReader.skip(Long.MAX_VALUE); long lines = lineNumberReader…
public class Test { //要进行截取操作的字符串 static String ss; //截取的字符串的字节数 static int n; public static void main(String[] args) { System.out.println("请输入字符串:"); //从键盘获取字符串 Scanner scStr = new Scanner(System.in); //将Scanner对象中的内容以字符串的形式取出来 ss = scStr.next(…