You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/code/projects/IToString/IToString/IToString.cs
-9Lines changed: 0 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,3 @@
1
-
/*
2
-
* The question of adding ToString methods to interface is a bit delicate and will certainly not be on any CSCI 1302 exam. The answer is, in short: you cannot force the implementation of a ToString with an interface.
3
-
* This is discussed at length at
4
-
* https://stackoverflow.com/q/510341
5
-
* where an alternative solution is provided (essentially: use an abstract class).
6
-
*
7
-
* Observe that this would compile just fine, even if Demo does not provide the implementation of a ToString method. Of course, Demo already posses a ToString method, the one every class inherits.
0 commit comments