import java.io.*;
public class application01

 
 public static void main(String[] args) 
 {   char c=' ' ;
    String s="";
  System.out.println("Enter a character Please ");
  try
  {  
   BufferedReader in= new BufferedReader(new InputStreamReader(System.in));
   s=in.readLine();
   //c=(char)System.in.read();
 } catch(IOException e){};
  System.out.println("you're  "+s);
  
 }
 
}想问一下里面//的作用。 我去掉//这个程序就没法运行,请问一下//在什么时候可以用。书上说//是注释的意思。但是用在这里却似乎有其他作用。搞不懂。

解决方案 »

  1.   

    能不能详细点,sky_cleaner()老大,//注释 到底是什么意思?书上介绍不是很清楚的。
      

  2.   

    /*
     * 创建日期 2005-11-17
     *
     * TODO 要更改此生成的文件的模板,请转至
     * 窗口 - 首选项 - Java - 代码样式 - 代码模板
     *//*
     * @author 
     *
     * TODO 要更改此生成的类型注释的模板,请转至
     * 窗口 - 首选项 - Java - 代码样式 - 代码模板
     *职工信息表
     */
    import java.io.*;
    class Employee1 
    {
    private String sName;
    private int iAge;
    private String sSex;
    private float fSalary;
    private String sMingzu;
    public Employee1()
    {
        try
        {
            BufferedReader inObj=new BufferedReader
             (new InputStreamReader(System.in));
            System.out.println("请输入职员名字:");
            sName=inObj.readLine();
            System.out.println("请输入职员的年龄:");
            iAge=Integer.parseInt(inObj.readLine());
            System.out.println("请输入职员的性别:");
            sSex=inObj.readLine();
            System.out.println("请输入职员的薪水:");
            fSalary=Float.parseFloat(inObj.readLine());
            System.out.println("请输入该职员的民族:");
            sMingzu=inObj.readLine();
            inObj.close();
        }catch(Exception e)
        {
            System.out.println(e);
        }
    }
            public void Display()
        {
            System.out.println("*********职员信息表*********");
            System.out.println("职工的名字是:\t"+sName);
            System.out.println("职工的年龄是:\t"+iAge);
            System.out.println("职工的性别是:\t"+sSex);
            System.out.println("职工的薪水是:\t"+fSalary);
            System.out.println("职工的民族是:\t"+sMingzu);
        }
        
    }
    public class Employee
    {
        public static void main(String args[])
        {
            Employee1 Tom=new Employee1();
            Tom.Display();
        }
    }
    终于写了个东西出来,兴奋啊!
      

  3.   

    回楼主的:import java.io.*;
    public class application01

     
     public static void main(String[] args) 
     {   char c=' ' ;
        String s="";
      System.out.println("Enter a character Please ");
      try
      {  
       BufferedReader in= new BufferedReader(new InputStreamReader(System.in));
       s=in.readLine();
       //c=(char)System.in.read();
     } catch(IOException e){};
      System.out.println("you're  "+s);
      
     }
     
    }
    jsdk  1.4  通过,运行正常!!准备接分!!谢谢啊.........
      

  4.   

    去掉//,在运行的时候就要输入两个参数
    Enter a character Please 
    f
    d
    you're f如果你输入一个参数,当然打印不出来you're f了,它在等你输入第二个参数呢。。