Comment on Anon tries programming in Java
Willem@kutsuya.dev 2 months agoOn that last note, can’t you use the explicit interface implementation in C#?
e.g.
public class SampleClass : IControl, ISurface { void IControl.Paint() { System.Console.WriteLine("IControl.Paint"); } void ISurface.Paint() { System.Console.WriteLine("ISurface.Paint"); } }
pivot_root@lemmy.world 2 months ago
I haven’t kept up with recent Java developments, but with Go, you’re out of luck. Interface implementations are—for both better and worse—completely implicit.
Amir@lemmy.ml 2 months ago
He mentioned C#, which does let you explicitly choose to implement same-name functions of two interfaces with different code
pivot_root@lemmy.world 2 months ago
For some reason, my brain inserted a “like” before “C#”, and answered the question of “can’t you use explicit interfaces like C#.”