0

Why we doesn't use variables in interfaces?

4th Aug 2016, 4:25 PM
S V R
S V R - avatar
3 Antworten
+ 3
Because interfaces are contracts, it only represent behavior.
12th Aug 2016, 4:04 AM
André Ribeiro
André Ribeiro - avatar
+ 1
You can use properties. Why do you need variables which could be accessed from other classes?
5th Aug 2016, 9:50 PM
Ivan G
Ivan G - avatar
0
There's no reason to. If you really need something similar that uses a variable, just use a normal abstract class. Also it's don't, not doesn't.
31st Aug 2016, 4:41 PM
OBV10U3_NINJA
OBV10U3_NINJA - avatar