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

Describe the following: (i) DNS (ii) Name Resolution (iii) Subnet Masking (iv) Urgent Pointer

1 Answers  


1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?

0 Answers   Accenture,


There is a room with 1000 light switches, numbered 1, 2, 3, 4, ... 1000, all turned off. Outside the room there are 1000 men, numbered man1, man2, ...man 1000 In order, each man walks into the room and changes the position of each switch that is a multiple of his number. That is: man1 flips every switch man2 flips switches 2, 4, 6, 8 ....1000 man3 flips switches 3, 6, 9, ..... 999 ..... Man 1000 flips switch 1000 After all 1000 men are done, how many switches are on?

3 Answers  


Given three sides of a triangle. Write the Program to determine whether the triangle is : 1) Invalid 2) Right Angled 3) Isoscales 4) Equilateral 5) Not Special An Isoscales right angled triangle should be taken as a Right Angled Triangle

3 Answers   FFC, Goldman Sachs, Student,


Is class is a abstract datatype in java?

0 Answers  


How to call dll API sub routine in VB Form.

0 Answers  


Please describe an example where you used object orientation in one of your programs.

0 Answers  


it is a language or tools?

0 Answers  


what is the software to run the GSM gate opener program

0 Answers  


What is web.configuration? how is it work? & wht is use this?

0 Answers  


preorder of A*(B+C)/D-G

6 Answers   BFL,


9. Read the function conv() given below conv(int t) { int u; u=5/9 * (t-32); return(u); } What is returned (a) 15 (b) 0 (c) 16.1 (d) 29

2 Answers   TCS,


Categories