can a method take parameters in interface? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

can a method take parameters in interface?

28th Jun 2016, 5:27 PM
Iqbal
3 Answers
+ 4
Any method written in an interface will have just declaration part of it..no body..And it can have all the parts that a normal method declaration has..that is return type, method name and parameters. The SPECIFIC thing about the methods in an interface is that they are always public and abstract. The method declaration should end with semicolon not either curly braces. .
28th Jun 2016, 6:31 PM
Shraddha -
Shraddha - - avatar
+ 3
yes methods in interface has signature(name and parameters) but interface not specify any implementation for these methods.
28th Jun 2016, 6:11 PM
Agnima Singh
Agnima Singh - avatar
0
I want to add that interface in c# 0.8 and onward can also have method implementation.
22nd Jun 2022, 8:44 PM
Sufian Ahmad
Sufian Ahmad - avatar