Results 1 to 4 of 4
  1. #1
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default What is an interface in the java? how to define

    hi good morning here

    i could not get the idea. that is, what does it( interface ) mean in java?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Have you refer any material about it?

    Anyway, interface is quite similar to an abstract class, means members are not implemented. Or group of method which has no body. See the following code.

    Java Code:
    interface myInterface
    {
    int addNumbers(int x, int y);
    void isGreat(int val);
    // and many more methods which has empty body
    }
    If you want, deal with access modifiers as well.

    If you want to implement it as follows,

    Java Code:
    public class MyClass implements myInterface
    {
    // do the required processing here
    }
    Think it is clear to you. Anything more.....

  3. #3
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default

    thank you very much

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. How to define Bean Scope
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-30-2008, 10:14 AM
  2. Interface java.io.Externalizable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-19-2007, 05:53 PM
  3. How to define Bean Scope
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 09-26-2007, 08:43 PM
  4. Help with define an integer field
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:32 AM
  5. Java GForge SOAP Interface 0.0.4
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 06-26-2007, 09:50 PM

Posting Permissions

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