这是程序的入口,java规定的,主类一定要这样写!
可以改变的是变量名args

解决方案 »

  1.   

    暂时来讲,好像是不可以变的。
    args只是参数的名称,爱换什么就换什么。不过C++存在争议,不知道Java怎么样。
      

  2.   

    麻烦那一位给我写一个
    c=a+b
    并打印出来的程序好吗?
    具体要求是:
    提示输入A,提示输入B
    打印A+B
      

  3.   

    不要用学c语言的这种面向过程的方法,去学习java的这种面向对象的语言!
      

  4.   

    好了,给你程序。import java.io.*;public class SimpleTest {
      public SimpleTest() {
      }
      public static void main(String[] args) {
        int a = 0, b = 0, c;    System.out.println("请输入A:");
        BufferedInputStream inA =
            new BufferedInputStream(System.in);
        try{
          a = inA.read();
        }catch(IOException e){
          System.err.println("IO错误。");
        }
        System.out.println("请输入B:");
        BufferedReader inB =
            new BufferedReader(
            new InputStreamReader(System.in));
        try{
          b = inB.read();
        }catch(IOException e){
          System.err.println("IO错误。");
        }
        a = Integer.parseInt(new String(new byte[]{(byte)a}));
        b = Integer.parseInt(new String(new byte[]{(byte)b}));    c = a + b;
        System.out.println("A+B= " + c);
      }}
      

  5.   

    我也有一个:import java.io.*;public class CaretakerTest  {
        public static void main(String[] args) {
            System.out.println("-----  Please edit text  -----");
            try {
              System.out.print("Enter A: ");
              BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
              String strA = in.readLine();
              int a = Integer.parseInt(strA);          System.out.print("Enter B: ");
              in = new BufferedReader(new InputStreamReader(System.in));          String strB = in.readLine();
              int b = Integer.parseInt(strB);          System.out.println(a + b);
            }
            catch (IOException e) {
              System.out.println("I/O Error !");
              System.exit(1);
            }catch(NumberFormatException e){
              System.out.println("Prease enter number!");
            }
          }
    }