Class Interface Interface
Class Interface Interface
CLASS INTERFACE
The keyword used to create a class is The keyword used to create an interface is
“class” “interface”
A class can be instantiated i.e, An Interface cannot be instantiated i.e,
objects of a class can be created. objects cannot be created.
Class does not support multiple Interface supports multiple inheritance.
inheritance.
It can be inherited by another class.It cannot inherit a class.
It can be inherited by another class It can be inherited by a class by using the
using the keyword ‘extends’. keyword ‘implements’ and it can be
inherited by an interface using the
keyword ‘extends’.
It can contain constructors. It cannot contain constructors.
It cannot contain abstract methods. It contains abstract methods only.
Variables and methods in a class can All variables and methods in a interface are
be declared using any access declared as public.
specifier (public, private, default,
protected)
Variables in a class can be static, All variables are static and final.
final or neither.