大峡,救我啊~~~~package Java.io does not exist??????????????????????????

jieremy 2002-03-14 05:10:09
why????
...全文
78 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
chalsy 2002-03-15
  • 打赏
  • 举报
回复
谢谢指正!
我近期在学VB,不小心就乱写了。在此道歉!
我是新人,以后还请多多指教!
hax 2002-03-15
  • 打赏
  • 举报
回复
BTW,纠正一点,JavaScript也是大小写敏感的。
jieremy 2002-03-14
  • 打赏
  • 举报
回复
谢谢上面的两个兄弟:)
真的谢谢了
ldgs 2002-03-14
  • 打赏
  • 举报
回复
兄弟,你这个程序我至少帮你改了十个错误!呵呵~~~~~~~~~

你试试下面的:
-------------------------------------------
import java.io.*;
public class ReadFromFile
{
public static void main(String args[])
{
try{
char ch;
System.out.println("please input a directory hat the file located in:");
StringBuffer strDir=new StringBuffer();
while((ch=(char)System.in.read())!='\n')
{
strDir.append(ch);
}
File dir=new File(strDir.toString());
System.out.println("please input the name of the file to read");
StringBuffer strFilename=new StringBuffer();
while((ch=(char)System.in.read())!='\n')
{
strFilename.append(ch);
}
File readFrom=new File(dir,strFilename.toString());
if (readFrom.isFile() && readFrom.canWrite() && readFrom.canRead())
{
RandomAccessFile rafFile=new RandomAccessFile(readFrom,"rw");
while(rafFile.getFilePointer()<rafFile.length())
System.out.println(rafFile.readLine()) ;
rafFile.close();
}
else
{
System.out.println("File can not be read!");
}
}catch(Exception e){
System.out.println("ERROR:----"+e.getMessage());
}
}
}
chalsy 2002-03-14
  • 打赏
  • 举报
回复
大姐!你不是问我吧?我的意思是你的这一段程序:

import Java.io.*;
public class ReadFromFile
{
……//以下略

应当该为:

import java.io.*;
public class ReadFromFile
{
……//以下略

我帮你编了一下,找不到 Java.io.*; 的问题没有了,不过还有9个其他的问题

顺便提一下,java不是JavaScript,java是区分大小写的!

jieremy 2002-03-14
  • 打赏
  • 举报
回复
怎么去寻找啊???
老大:)
SORRY,很菜的问题
chalsy 2002-03-14
  • 打赏
  • 举报
回复
有“Java.io.*; ”这个包吗?
还是"java.io.*; "呢?
jieremy 2002-03-14
  • 打赏
  • 举报
回复
好的。大虾请看:
import Java.io.*;
public class ReadFromFile
{
public static void main(String args[])
{
char ch;
System.out.println("please input a directory hat the file located in:");
StringBuffer stfDir=new StringBuffer();
While((ch=(char)System.in.read())!='\n')
{
strDir.appendChar(ch);
}
File dir=new File(strDir.toString());
System.out.println("please input the name of the file to read");
StringBuffer strFilename=new StringBuffer();
While((ch=(char)System.in.read())!='\n')
{
strFilename.appendChar(ch);
}
File readFrom=new File(dir,strFilename.toString());
if (readFrom.isFile() && readFrom.canWrite() && readFrom.canRead())
{
RandomAccessFile rafFile=new RandomAccessFile(ReadFrom,"rw");
while(rafFile.getFilePointer()<rafFile.length())
System.out.println(rafFile.readLine())
rafFile.close();
}
else
{
System.out.println("File can not be read!");
}
}
}
chalsy 2002-03-14
  • 打赏
  • 举报
回复
同意!要不那些大虾们哪能知道到底哪里有问题?
ldgs 2002-03-14
  • 打赏
  • 举报
回复
贴源代码。

23,409

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧