+ 2

What is an interface in java?

10th Jun 2017, 5:23 AM
suryapoojary
suryapoojary - avatar
5 Réponses
+ 3
Interfaces are quite advanced stuff. I don't know much about it, I only know that it's an abstract class with abstract methods in it. Sorry. It's explained in the Java Course, in "More on classes" chapter.
10th Jun 2017, 6:31 AM
Baptiste
Baptiste - avatar
+ 2
hehehe..np @Baptiste
10th Jun 2017, 6:32 AM
suryapoojary
suryapoojary - avatar
+ 2
The interface in java is a mechanism to achieve abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve abstraction and multiple inheritance in Java.
11th Jun 2017, 3:46 AM
Nikhil
Nikhil - avatar
0
interface is same like but u can only declare the method within interface,,though after java8 u can define also...u have to implement ur method in a class
10th Jun 2017, 7:26 AM
Somnath Ghosh
Somnath Ghosh - avatar
0
Interfaces are purely abstract. You can't define a constructor within that. Interfaces are mainly used for coupling stuffs. For loose coupling, interfaces are used.
10th Jun 2017, 7:32 AM
Ayush
Ayush - avatar