Skip to main content

Difference between Class and Interface

Java Programming


  *Difference between Class and Interface

                                                Class

1. The members of a class can be constant or variables. 

2. The class definition can contain code for each of its methods. That is, the methods can be    abstract or non-abstract.

3. It can be instantiated by declaring objects.

4. It can use various access specifier like public,private or protected. 


                                             Interface   

1. The members of an interface are always declared as constant, i.e. their values are final. 

2. The methods in an interface are abstract in nature, i.e., there is no code associated with   them. It is later defined by the class that implements the interface.

3.  It cannot be used to declare objects. It can only be inherited by a class. 

4.  It can only use the public access specifier.




Comments

RAW_BOY said…
nice way to explane
Abhishek said…
Thank you for your feedback

Popular posts from this blog

Byte Code:

Java Programming Byte Code: It is the unique characteristic property of the Java programming language. It is something like a normal text file. Therefore, it cannot be affected by virus. It is an intermediate between a human readable source and machine readable source. Byte codes are plate form independent. Therefore, JVM is plate form dependent to make Java programming plate form indepdent.  

DBMS LEARNING SHEET

                                                            Types of DATA Structured data are facts concerning objects and events. The most important structured data are numeric, character, and dates. Structured data are stored in tabular form. Unstructured data are multimedia data such as documents, photographs, maps, images, sound, and video clips. Unstructured data are most commonly found on Web servers and Web-enabled databases. Database A database is a collection of data that is organised in such a way that it provides efficient retrieval of desired information. This collected data could be in any format like printed, audio, electronic and graphic. Consider an example of an address book, it is also a database that provides information of personal contacts of persons. DBMS A Database Mana...