当前位置: 技术问答>java相关
虽然简单,但是还请个位帮帮忙,可能是CLASSPATH的问题
来源: 互联网 发布时间:2017-04-02
本文导语: 出错程序代码: import Java.io.*; public class Fileio { public static void main(String args[]) { char c; System.out.print("Enter a character please:"); try{ c=(char)System.in.read(); } ...
出错程序代码:
import Java.io.*;
public class Fileio
{
public static void main(String args[])
{
char c;
System.out.print("Enter a character please:");
try{
c=(char)System.in.read();
}
catch(IOException e){
};
System.out.println("you've entered character"+c);
}
}
我估计是这句import Java.io.*;出错了,因为提示出错是:package JAVA.io does not exist
我的CLASSPATH是.;g:javalibtools.jar;..........
我该在哪里找到JAVA。IO这些包呢???
import Java.io.*;
public class Fileio
{
public static void main(String args[])
{
char c;
System.out.print("Enter a character please:");
try{
c=(char)System.in.read();
}
catch(IOException e){
};
System.out.println("you've entered character"+c);
}
}
我估计是这句import Java.io.*;出错了,因为提示出错是:package JAVA.io does not exist
我的CLASSPATH是.;g:javalibtools.jar;..........
我该在哪里找到JAVA。IO这些包呢???
|
import java.io.*;
老兄,java里区分大小写,改过来就可以了
再有,c要初始化,import java.io.*;
如下:
public class Fileio
{
public static void main(String args[])
{
char c=' ';
System.out.print("Enter a character please:");
try{
c=(char)System.in.read();
}
catch(IOException e){
};
System.out.println("you've entered character "+c);
}
}
老兄,java里区分大小写,改过来就可以了
再有,c要初始化,import java.io.*;
如下:
public class Fileio
{
public static void main(String args[])
{
char c=' ';
System.out.print("Enter a character please:");
try{
c=(char)System.in.read();
}
catch(IOException e){
};
System.out.println("you've entered character "+c);
}
}