identifier expected error

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

  1. manoj212077

    manoj212077

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

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:
    6,089
    barry
    Dec 25, 2005
  2. Robert Stiff

    Error: <identifier> expected

    Robert Stiff, Nov 5, 2003, in forum: Java
    Replies:
    2
    Views:
    9,111
    Harald Hein
    Nov 6, 2003
  3. Tim
    Replies:
    11
    Views:
    119,342
    drzplaya1121
    Dec 8, 2009
  4. Tony Tone
    Replies:
    7
    Views:
    15,400
    Tony Tone
    Apr 28, 2006
  5. Conor

    <identifier> expected error

    Conor, Oct 3, 2006, in forum: Java
    Replies:
    4
    Views:
    7,554
    Oliver Wong
    Oct 4, 2006
  6. aarthi28@gmail.com
    Replies:
    2
    Views:
    2,181
    chris_doran@postmaster.co.uk
    Feb 26, 2007
  7. jiali2121@yahoo.com

    Identifier Expected Error in JSP page

    jiali2121@yahoo.com, Jun 29, 2007, in forum: Java
    Replies:
    1
    Views:
    1,544
    Roedy Green
    Jun 29, 2007
  8. S_K
    Replies:
    0
    Views:
    856
Loading...