what is different betweet class and interface in java?

Answers were Sorted based on User's Feedback



what is different betweet class and interface in java?..

Answer / 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

what is different betweet class and interface in java?..

Answer / wipro company

do not return value of funtion in interface but return
value of funtion in the class

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

1 Answers  


SAS using companies in INDIA

29 Answers   Bank Of America, Cap Gemini, Hyundai, IBM, KO, Sristek, TCS, Wipro, WNS,


Given a set. Write the pseudo code to get all the subsets for the given set. Eg. Input : {1,2} Output : (),(1),(2),(1,2)

0 Answers   Goldman Sachs,


Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains

0 Answers  


I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??

0 Answers  






Suppose server object is not loaded into the memory, and the client request for it , what will happen?

0 Answers  


How to find the aerry size

1 Answers   Cap Gemini,


Which of the following are Java modifiers?

0 Answers  


How should a programmer decide whether to use a macro or a subroutine to accomplish a given logical function

1 Answers   R V College of Engineering, University of Jordan,


A, B and C are 8 bit nos. They are as follows: A 1 1 0 1 1 0 1 1 B 0 1 1 1 1 0 1 0 C 0 1 1 0 1 1 0 1 Find ( (A-B) u C )=? how to solve this need with steps

5 Answers   TCS,


Write a Pseudo Code to find the angle between two hands of a clock for a given time.

6 Answers   Goldman Sachs, HCL,


How will you prove that java swing is multithreaded?

0 Answers  


Categories