Advertisement



< Prev
Next >



Interface in Java





An interface is a 100% abstract class which is declared with the interface keyword. Methods of an interface are implicitly abstract, hence when declaring an interface, you must not provide an implementation of any of its methods and its methods should end with a semicolon ;

//Java - Example of an interface

interface A
{
	// Unlike regular methods, method of an interface 
	// should not be implemented within a pair of curly braces {} and,
	// each method of an interface should end with a semicolon.
	void getName();  
}





Some important points about interface.






Please share this article -




< Prev
Next >
< Abstract Class
Final keyword in Java >



Advertisement

Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement



Notifications



Please check our latest addition

C#, PYTHON and DJANGO


Advertisement