Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    18
    Rep Power
    0

    Default what is wrong wid this code??(interface)

    interface applicant
    {
    public void details(String args[]);
    }
    class candidate implements applicant
    {
    int id;
    String name,add,pos;
    public void details(String args[])
    {
    for(int i=0;i<args.length;i++)
    System.out.println("id"+args[i]+"name"+args[i]+"add"+args[i]+"pos"+args[i]);
    }
    }
    class emp
    {
    public static void main(String args[])
    {
    candidate c=new candidate();
    c.details();
    }
    }

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by swathi dharmaraj View Post
    interface applicant
    {
    public void details(String args[]);
    }
    class candidate implements applicant
    {
    int id;
    String name,add,pos;
    public void details(String args[])
    {
    for(int i=0;i<args.length;i++)
    System.out.println("id"+args[i]+"name"+args[i]+"add"+args[i]+"pos"+args[i]);
    }
    }
    class emp
    {
    public static void main(String args[])
    {
    candidate c=new candidate();
    c.details();
    }
    }
    See if your candidate class has a 'details'method that doesn't take any arguments at all; the compiler already told you that it couldn't find one if you actually had read its diagostic messages. b.t.w. if you want your class 'emp' to be the entry point of your program you should make it a public class.

    kind regards,

    Jos

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    It's not in code tags?

  4. #4
    Join Date
    Sep 2010
    Posts
    18
    Rep Power
    0

Similar Threads

  1. What Could be Wrong with This code????
    By Manfizy in forum New To Java
    Replies: 9
    Last Post: 08-22-2010, 12:28 PM
  2. Need help! something wrong in my code
    By novak100 in forum New To Java
    Replies: 2
    Last Post: 11-19-2009, 12:59 AM
  3. what's wrong with my code? please help me...
    By lovely23 in forum Java Applets
    Replies: 2
    Last Post: 03-01-2009, 02:33 PM
  4. What's wrong with this code?
    By Doctor Cactus in forum New To Java
    Replies: 4
    Last Post: 11-29-2008, 06:44 PM
  5. what is wrong with this code
    By masaka in forum New To Java
    Replies: 5
    Last Post: 04-16-2008, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •