Bonjour,
j'ai des erreurs bizarres qui surviennent lorsque je compile.
Voici mes 2 fichiers:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 public class Point { public Point(int x,int y) { this.x=x; this.y=y; } public int getX() { return x; } public int getY() { return y; } @Override public String toString() { return "("+x+','+y+')'; } private final int x; private final int y; }A la compilation j'ai
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 public class Main{ public static void main(String [] args){ Point p = new Point(1,2); System.out.println(p); } }
alors que j'ai java 1.5:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 javac Main.java Found 1 semantic error compiling "Main.java": 3. Point p = new Point(1,2); ^---^ *** Semantic Error: A candidate for type "Point" was found, but it is invalid and needs to be fixed before this type will successfully compile. Found 1 semantic error compiling "Point.java": 18. @Override public String toString(){ ^-------^ *** Semantic Error: Annotation modifiers are only supported for `-source 1.5' or greater.(not yet implemented)
Je suis sous Ubuntu
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Partager