class Dog {
int size;
String name;
void bark() {
if (size > 60) {
System.out.println("汪汪汪汪汪汪!");
} else if (size > 14) {
System.out.println("汪汪汪!");
} else {
System.out.println("喔喔喔!");
}
}
}
public class DogTestDrive {
public static void main (String[] args)
Dog one = new Dog();
one.size=64;
Dog two = new Dog();
two.size=20;
Dog three=new Dog();
three.size=12;
one.bark();
two.bark();
three.bark();
}
}
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:17: error: ';' expected
public static void main (String[] args)
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:20: error: <identifier> expected
one.size=64;
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:23: error: <identifier> expected
two.size=20;
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:26: error: <identifier> expected
three.size=12;
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:28: error: <identifier> expected
one.bark();
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:29: error: <identifier> expected
two.bark();
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:30: error: <identifier> expected
three.bark();
^
/judge/data/20131208/1386512841010_java_15690/DogTestDrive.java:33: error: class, interface, or enum expected
}
^
8 errors
编译错误 |