Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > identifier expected error

Reply
Thread Tools

identifier expected error

 
 
manoj212077 manoj212077 is offline
Junior Member
Join Date: Sep 2009
Posts: 5
 
      09-07-2009
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(42;
//c.nonIface();
//c.add(2,5);
client d = new client();
c = d;
//c.nonIface();
d.nonIface();
d.callback(7;
d.add(3,4);
d.callback(2,6);
Fig f = new client();
f.callback(34);
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSD Error: "Expecting '.', identifier or quoted identifier withmultiple tables. S_K ASP .Net 0 08-06-2008 09:22 PM
How can I fix the warning C4786 'identifier' : identifier wastruncated to 'number' characters in the debug information...? babakandme@yahoo.com C++ 2 12-11-2007 08:17 PM
identifier not found error, undeclared identifier aarthi28@gmail.com C++ 2 02-26-2007 02:11 AM
expected identifier error barry ASP .Net 6 12-25-2005 05:10 AM
Trying to declare identifier locally and hide a file scope identifier Kobu C Programming 7 02-25-2005 05:19 AM



Advertisments