Results 1 to 5 of 5

Thread: what is interface in java

  1. #1
    Join Date
    Dec 2010
    Posts
    68

    what is interface in java

    I’m a student of bsc-it and a beginner in programming language. We have a core java as a subject and in our syllabus there is a topic called ‘interface’ is there. I wan’t to understand the concept of interface. can you please tell me what is interface actually mean in java and what is the use of it. I’ll be very thankful to you if you can give me some detail about this topic. Please help me, this is very important topic in java.

  2. #2
    Join Date
    May 2008
    Posts
    913

    Re: what is interface in java

    Interface is a group of related methods with an empty body. In interface you have to declare a method which you want to use in next class. You have to only declare a method in interface and implement that method in another class. The interface does’nt include a ‘class’ keyword before the name of a class. The interface always implemented by the following class of interface. Interface is introduced to implement multiple inheritance in java. Multiple inheritance is not use directly in java, it is used through interface.

  3. #3
    Join Date
    May 2008
    Posts
    913

    Re: what is interface in java

    Interface is a group of related methods with an empty body. In interface you have to declare a method which you want to use in next class. You have to only declare a method in interface and implement that method in another class. The interface does’nt include a ‘class’ keyword before the name of a class. The interface always implemented by the following class of interface. Interface is introduced to implement multiple inheritance in java. Multiple inheritance is not use directly in java, it is used through interface.

  4. #4
    Join Date
    Nov 2008
    Posts
    1,054

    Re: what is interface in java

    In java, interface is not a class it is a reference type. It can contain only signature, nested type and constant. Interface contains only declaration of method and body of that method is contain by the class which extend the interface. The interface is contains a constant variable. i.e.. a variable which does’nt change. If you want to know more about the interface than you can refer to a reference book of java. The author of the book is Herbert schild. You will find complete detail about the interface in that book.

  5. #5
    Join Date
    May 2008
    Posts
    979

    Re: what is interface in java

    Interface is a abstract type in java. In interface there is a data variable which has constant declaration and method declaration. Constant declaration means variable declaration that are declared to both static and final. Interface never contain method definition, interface never instantiated i.e..no object of interface is created and the data variable which is used in interface is also not instantiated because it is static. For more details on interface you can refer to a reference book or search online there are many pdf available online.

Similar Threads

  1. CharSequence interface problem in Java
    By Feng in forum Software Development
    Replies: 7
    Last Post: 06-08-2010, 06:18 AM
  2. Shape interface of java
    By Gajananvihari in forum Software Development
    Replies: 4
    Last Post: 09-03-2010, 05:08 PM
  3. SpinnerModel interface of java
    By Gadin in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 12:56 PM
  4. Action Interface of java
    By Protectors in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 08:19 AM
  5. ButtonModel interface of java
    By Gokul20 in forum Software Development
    Replies: 5
    Last Post: 22-02-2010, 12:48 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,721,931,933.06077 seconds with 17 queries