⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filedemo8.java

📁 JAVA程序设计课程中各章节的程序实例。
💻 JAVA
字号:
/**
*Another simple file demostration program
*Reads the source code from the disk and displays the code on the screen

*/

import java.io.*;

class fileDemo8
{
	public static void main(String args[]) throws IOException
	{
		byte[] b = new byte[800];
		FileInputStream fin = new FileInputStream("fileDemo8.java");
		int bytes = fin.read(b,0,800);
		String str = new String(b,0,bytes);
	/*-------------------------------------------------------------------------------
	 	public String(byte[] bytes, int start, int count)
		This constructor creates a new String,which value equals to the String from
		the "start" location in the "byte[]",and lasts for "count" characters
	-------------------------------------------------------------------------------*/
		System.out.println(str);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -