当前位置: 技术问答>java相关
大家帮我看一下!解决后立刻给分(在线等待)
来源: 互联网 发布时间:2017-03-28
本文导语: import java.io.*; public class SimpleIO { public static void main(String[]args) { char c; system.out.print("Enter a letter:"); try{ c=(char)system.in.read(); }catch(IOException e){}; system.out.println("The letter is :"+c); } } ------------...
import java.io.*;
public class SimpleIO {
public static void main(String[]args) {
char c;
system.out.print("Enter a letter:");
try{
c=(char)system.in.read();
}catch(IOException e){};
system.out.println("The letter is :"+c);
}
}
-------------------------------------------------------------------
import java.applet.Applet;
jmport java.awt.*;
public class JavaProgram2 extends Applet {
Public void paint(Graphics g) {
g.drawString("I have been a programmer of Java Applet!",10,20);
}
}
这两个哪里出错了?能给我讲一下错的原因吗?
public class SimpleIO {
public static void main(String[]args) {
char c;
system.out.print("Enter a letter:");
try{
c=(char)system.in.read();
}catch(IOException e){};
system.out.println("The letter is :"+c);
}
}
-------------------------------------------------------------------
import java.applet.Applet;
jmport java.awt.*;
public class JavaProgram2 extends Applet {
Public void paint(Graphics g) {
g.drawString("I have been a programmer of Java Applet!",10,20);
}
}
这两个哪里出错了?能给我讲一下错的原因吗?
|
多看看书吧
import java.io.*;
public class Test2{
public static void main(String[]args) {
char c;
System.out.print("Enter a letter:");
try{
c=(char)System.in.read();
System.out.println("The letter is :"+String.valueOf(c));
}catch(IOException e){};
}
}
import java.io.*;
public class Test2{
public static void main(String[]args) {
char c;
System.out.print("Enter a letter:");
try{
c=(char)System.in.read();
System.out.println("The letter is :"+String.valueOf(c));
}catch(IOException e){};
}
}
|
catch(IOException e){};
system.out.println("The letter is :"+c);
}
????????????????????????????????
system.out.println("The letter is :"+c);
}
????????????????????????????????
|
程序运行时提示什么错误?