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

📄 example7_2.java

📁 《Java程序设计与应用》-张仕斌-源程序 《Java程序设计与应用》-张仕斌-源程序
💻 JAVA
字号:
/*
 * Example7_2.java
 *
 * Created on 2006年9月15日, 下午4:53
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package example7_2;
import java.io.*;
/**
 *
 * @author Administrator
 */
public class Example7_2 {
    
    /** Creates a new instance of Example7_2 */
    public Example7_2() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException{
        // TODO code application logic here
   String tmp = "abc";
  byte b[] = tmp.getBytes();   //数据源
  ByteArrayInputStream in = new ByteArrayInputStream(b);  //创建字节数组流对象
  for (int i=0; i<2; i++) {
   int c;
   while ((c = in.read()) != -1) {
    if (i == 0) { System.out.print((char) c);} 
    else {System.out.print(Character.toUpperCase((char) c));}
   }
   System.out.println();
   in.reset();
  }
 
    }
    
}

⌨️ 快捷键说明

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