我有以下代码:
/* Demonstrate the if.
Call this file IfDemo.java. */
package ifdemo;
public static void main(String args[}) {
int a,b,c;{
a=2;
b=3;
if (a<b) System.out.println("A is less than B");
//this won't display anything if (a==b) System.out.println("You won't see this")
System.out.println();
c=a-b; // C contains -1
System.out.println("C contains -1");
if (C >= 0) system.out.println("C is non-negative");
if (C < 0) system.out.println("C is negative");
System.out.println();
C=b-a; //C contains 1
System.out.println("C contains 1");
if (C >=0)System.out.println("C is non-negative");
if (C<0)System.out.println("C is negative");
}}
在这一行: public static void main(String args[} ) { 我得到三个错误: 1. 令牌“void”上的语法错误,@ 预期 2. 令牌上的语法错误,应改为类头 3. 令牌上的语法错误,放错位置结构体
我希望你们能帮助我。
提前致谢。