Topic: 一道RandomAccessFile类的问题 |
Print this page |
1.一道RandomAccessFile类的问题 | Copy to clipboard |
Posted by: Adolfmark Posted on: 2008-11-19 16:14 如何实现用randomaccessfile类读出一个文件的后5行的数据 我的代码如下:
本人初学java不久,这个程序写了半天也没有实际效果,不知道该如何下手了,特向群里的朋友们请教,谢谢 |
2.Re:一道RandomAccessFile类的问题 [Re: Adolfmark] | Copy to clipboard |
Posted by: micsolaris Posted on: 2008-11-19 20:37 package com.ricky.www; 用这个看看。但是虽然说涉及到RandomAccessFile,其实用得还是FileInputStream,但能实现你要的功能。 |
3.Re:一道RandomAccessFile类的问题 [Re: Adolfmark] | Copy to clipboard |
Posted by: Adolfmark Posted on: 2008-11-20 18:28 我写了两天了,还没用RandomAccessFile实现这个效果,估计光用这个类是无法实现了,也不知道那个出题的教授怎么想的 也不给个答案 郁闷 |
4.Re:一道RandomAccessFile类的问题 [Re: Adolfmark] | Copy to clipboard |
Posted by: Adolfmark Posted on: 2008-11-20 18:46 谢谢你的回答 |
5.Re:一道RandomAccessFile类的问题 [Re: Adolfmark] | Copy to clipboard |
Posted by: Adolfmark Posted on: 2008-11-20 20:35 搞定了 感觉奇士 不然我肯定是弄不出来的
|
6.Re:一道RandomAccessFile类的问题 [Re: Adolfmark] | Copy to clipboard |
Posted by: JiafanZhou Posted on: 2008-11-22 00:50 I really appreciate that you have completed yourself with your question. Three minor things with your code: 1. Class name begins with a capital letter by convention. And it should not be incomprehensible. 2. catch(IOException e){} It is usually a bad idea, not to catch exception. 3. Give comments to your program. Jiafan |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |