identifier expected error

Discussion in 'Java' started by manoj212077, Sep 7, 2009.

  1. manoj212077

    manoj212077

    Joined:
    Sep 6, 2009
    Messages:
    5
    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);
    }
    }
    manoj212077, Sep 7, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. barry

    expected identifier error

    barry, Dec 24, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,768
    barry
    Dec 25, 2005
  2. Kobu
    Replies:
    7
    Views:
    449
  3. aarthi28@gmail.com
    Replies:
    2
    Views:
    1,750
    chris_doran@postmaster.co.uk
    Feb 26, 2007
  4. babakandme@yahoo.com
    Replies:
    2
    Views:
    896
    Owen Jacobson
    Dec 11, 2007
  5. S_K
    Replies:
    0
    Views:
    651
Loading...

Share This Page