java2实验手册求方程的根,Java实验五报告

《Java实验五报告》由会员分享,可在线阅读,更多相关《Java实验五报告(6页珍藏版)》请在读根文库上搜索。

1、实验五 Java 输入输出流 1实验目的(1) 掌握输入输出流的总体结构;(2) 掌握流的概念;(3) 了解各种流(包括文件流、管道流、连接文件、过滤流、对象的序列化、随机访问)的使用。2实验内容实验题1 编写一个Java Application程序,打印命令行输入的所有参数。基本要求 编写完整程序。import java.util.Scanner;public class Application public static void main(String args)String num;String name;String dept;Scanner reader = new Scanner。

2、(System.in);System.out.println(输入学号:);num = reader.nextLine();System.out.println(输入姓名:);name=reader.nextLine();System.out.println(输入专业:);dept=reader.nextLine();System.out.println(学号:+num+姓名:+name+ 专业:+dept); 2实验题2 阅读下面程序,叙述其功能package cn.edu.nwsuaf.jp;import java.io.FileReader;import java.io.IOExcept。

3、ion;public class FileViewer /* Defines the entry point of the program. */public static void main(String args) System.out.println(Please enter the file path:);try String fileName = ;while(true) int readByte = System.in.read();if(readByte = -1 | readByte = r)break;fileName += (char) readByte;/ Reads t。

4、he file and prints it to the System.out stream.char buffer = new char20;FileReader reader = new FileReader(fileName);while(true) int length = reader.read(buffer);if(length =a& si=A & si=Z)y+;String STR = str.toUpperCase();w.write(STR + n);r.close();w.close();System.out.println(小写字母:+x+个);System.out.println(大写字母:+y+个); catch (IOException e) e.printStackTrace();3实验总结通过这次实习,我熟悉了输入输出流的基本结构,学会了一些基本流的运用。但是,对于文件流字符流的写入不是很熟练,实习题4求水仙花数的程序,有点难度,而且输出的那个data.txt文件中,始终只有最后一行的输出,这个题还得仔细研究和学习。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值