identifier expected error

Joined
Sep 6, 2009
Messages
5
Reaction score
0
i have error in line no.4 and 5
in 4 ..variable final must be initialized
in 5.identifier expected
//import java.io.*;
interface callback {
void callback(int parm);
int i;
i = 10;
}
class client implements callback,Fig {
public void callback(int p) {
System.out.println("callback called with"+p);
}
public void callback(int p,int q) {
System.out.println("callback called with"+(p+q));
}
void nonIface() {
System.out.println("classes that implents that also defined other method");
}
public void add(int a,int b){
System.out.println("sum="+(a+b));
}
}
interface Fig {
void add(int a,int b);
void callback(int parm);
}
class TestIface {
public static void main(String args[]) {
callback c = new client();
c.callback(428);
//c.nonIface();
//c.add(2,5);
client d = new client();
c = d;
//c.nonIface();
d.nonIface();
d.callback(78);
d.add(3,4);
d.callback(2,6);
Fig f = new client();
f.callback(34);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top