what is different betweet class and interface in java?

Answer Posted / gyana

In java by using class we cannot use concept of multiple
inheritance.but by using interface we can apply multiple
inheritance.

Class is a userdefined type declaration.Interface is a set
of rules that all d classes and interface who use it should
be obey the rule.

Normal class:-


class abc
{
public void a()
{}
}

interface declaration

Interface Iabc
{
public void ok()
{

}
}

class using interface

class abc:Iabc
{
public void ok()
{
string a="ABC";
return a;
}
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get the index of the clicked field in reports in ABAP?

1161


can we allocate memory for interface? if no then why?

1470


What are two of your strengths that you will bring to our QA/testing team?

1648


how pseudo column works?

1723


Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.

1554






Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1760


what is meant by life cycle of a business

1701


Need provab technical test questions

2395


In project we have Documentation phase also,in that what is micro and macro designing?

1426


can we retrieve only integer/String type columns from a table,if yes how?

1503


what is meaning of MDM in sap?let me know that meaning

1685


qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

2356


how do we provide security for web services

1811


how does database connection using ADO.NET?

1522


< DL Compact > tag is used for

1549