Ik heb een zeer vaag probleem waarbij die om een identifier vraagt terwijl de string gewoon een waarde heeft.
Bij de System.out.println(uitvoer) geeft die: Identifier expected. Maar er staat toch een identifier?
Bij de System.out.println(uitvoer) geeft die: Identifier expected. Maar er staat toch een identifier?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
| import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class opdracht5
{
private IntAImpl1 impl1=new IntAImpl1("hoi", "hallo", "dag");
private IntAImpl2 impl2=new IntAImpl2("hanze", "jesse", "gerson");
private IntBImpl1 impl3=new IntBImpl1("athlon", "cola", "appeltaart");
private IntBImpl2 impl4=new IntBImpl2("test", "ditis", "opdracht5");
String uitvoer1=impl1.aGeeftString();
String uitvoer2=impl2.aGeeftString();
String uitvoer3=impl3.bGeeftString();
String uitvoer4=impl4.bGeeftString();
System.out.println(uitvoer1);
//Hier geeft die een error^ error Identifier Excpected.
//Wat is de fout?
System.out.println(uitvoer2);
//dit gaat dan ook fout natuurlijk
System.out.println(uitvoer3);
System.out.println(uitvoer4);
public interface IntA
{
public String aGeeftString();
}
public interface IntB
{
public String bGeeftString();
}
public class IntAImpl1 implements IntA
{
private String a,b,c;
private String uitvoer;
public IntAImpl1 (String a, String b, String c)
{
this.a=a;
this.b=b;
this.c=c;
}
public String aGeeftString()
{
uitvoer=a.toUpperCase();
return uitvoer;
}
}
public class IntAImpl2 implements IntA
{
private String a,b,c;
String uitvoer;
public IntAImpl2 (String a, String b, String c)
{
this.a=a;
this.b=b;
this.c=c;
}
public String aGeeftString()
{
uitvoer=a.toUpperCase();
return uitvoer;
}
}
public class IntBImpl1 implements IntB
{
private String a,b,c;
private String uitvoer;
public IntBImpl1 (String a, String b, String c)
{
this.a=a;
this.b=b;
this.c=c;
}
public String bGeeftString()
{
uitvoer=a.toUpperCase();
return uitvoer;
}
}
public class IntBImpl2 implements IntB
{
private String a,b,c;
private String uitvoer;
public IntBImpl2 (String a, String b, String c)
{
this.a=a;
this.b=b;
this.c=c;
}
public String bGeeftString()
{
uitvoer=a.toUpperCase();
return uitvoer;
}
}
} |