0

I am trying to implement a Java program but before going into that, I am confused with regard to methods being used in an interface or an abstract class.
Can somebody guide me on this and provide the reasons for doing so?
I am new to Java.

Here are the some of the methods.

Interface class:

public interface SampleInterface 
{
    void AddData();
    void DisplayData(int key,String value);
    void DisplayAllData();
    void DeleteData(int key,String value);
    void UpdateData(int key,String value);
    void IndexSearchdata(int key);
    void SortingObjDesc();
    void SortingObjAsc();
}

abstract Class:

public abstract class SampleAbstract 
{
    abstract void AddData();
    abstract void DisplayData(int key,String value);
    abstract void DisplayAllData();
    abstract void DeleteData(int key,String value);
    abstract void UpdateData(int key,String value);
    abstract void IndexSearchdata(int key);
    abstract void SortingObjDesc();
    abstract void SortingObjAsc();
}
almightyGOSU
  • 3,731
  • 6
  • 31
  • 41
senthil kumar
  • 237
  • 1
  • 6
  • 18
  • Thank you for providing the code in context of your question. However, please [edit] and clarify because _what you're trying to do_ and are confused about is not entirely clear. – William Price Jun 01 '15 at 04:48
  • I'm trying to understand your question a little better. Are you trying to determine what methods can go in an abstract class verses what ones can go in an interface? – augray Jun 01 '15 at 04:48
  • thank for reply those are the set of method i can implement by own so before to use i need to implement these method in interface or abstract to learn there usage now i created these way but i dono which method i can used in interface or in abstract so only i approached here ..kindly provide general idea for those method which class i need to implement – senthil kumar Jun 01 '15 at 04:55
  • @augray u r correct .that is what i want... – senthil kumar Jun 01 '15 at 04:56
  • here i am not asking about comparsion those are the method i want to implement but dono which method go which class – senthil kumar Jun 01 '15 at 05:00

0 Answers0