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 is the difference between COM and CORBA?

0 Answers   Yahoo,


Create a class TicTacToe that will enable you to write a complete program to play the game of Tic-Tac-Toe. The class contains as private data a 3- by-3 double array of integers. The constructor should initialize the empty board to all zeros. Allow two human players. Wherever the first player moves, place a 1 in the specified square; place a 2 wherever the second player moves. Each move must be to an empty square. After each move determine whether the game has been won and whether the game is a draw. If you feel ambitious, modify your program so that the computer makes the moves for one of the players automatically. Also, allow the player to specify whether he or she wants to go first or second. If you feel exceptionally ambitious, develop a program that will play three-dimensional Tic-Tac-Toe on a 4-by-4-by-4

2 Answers  


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

0 Answers  


what is the current salary package in India for a lamp programmer

0 Answers   HCL,


how will you code the subfile which is in editing mode (multiple case subfile)?

0 Answers   Bank Of America,


I am looking for selenium RC online Training in chennai. can any one tell me the best institute

0 Answers  


Hello Experts, What is the difference between move and move corresponding exactly? please post me asap

0 Answers  


how to add a new table with variables and thier values into a imported file uisng proc import?

0 Answers  


what do you man by firmware

4 Answers  


How do you initialize a static member of a class with return value of some function?

0 Answers   Yahoo,


1. What coding languages are you comfortable with?

1 Answers  


suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

0 Answers   Bank Of America,


Categories