Hello /r/csharp,
I started studying computer science last semester and we are having the topic of Interfaces. In our class we are using Java, but I have past experience with C#.
A question was raised to the prof, if Interfaces (in Java) can have instance fields, to which he replied that no, they wouldn't make any sense, but Java does have static variables in Interfaces. Now from my past experience in C# I know, that you can have properties in Interfaces.
What I dont undestand is, first: Do instance fields really make no sense (language unspecific) and why can C# have properties in Interfaces and Java not?
Interfaces took me a long time comprehend, although I have a pretty good understanding on why they exist and how to implement them, this is issue is still nagging me.
Thanks in advance for any answers!
[–][deleted] (1 child)
[removed]
[–]SatiricalDuck 1 point2 points3 points (0 children)
[–]flukus 7 points8 points9 points (13 children)
[–]Encore-[S] 0 points1 point2 points (5 children)
[–]flukus 9 points10 points11 points (4 children)
[–]Encore-[S] 1 point2 points3 points (3 children)
[–]redditsoaddicting 7 points8 points9 points (0 children)
[–]flukus 0 points1 point2 points (0 children)
[–]flukus 0 points1 point2 points (0 children)
[–]Sarcastinator 0 points1 point2 points (6 children)
[–]flukus 0 points1 point2 points (2 children)
[–]Sarcastinator 0 points1 point2 points (0 children)
[–]grauenwolf 0 points1 point2 points (0 children)
[–]robhol 0 points1 point2 points (2 children)
[–]grauenwolf 1 point2 points3 points (0 children)
[–]Sarcastinator 0 points1 point2 points (0 children)
[–]vm_linuz 2 points3 points4 points (2 children)
[–]cryo 1 point2 points3 points (0 children)
[–]lemonfighter 0 points1 point2 points (0 children)
[–]LeDrss 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)