❔ interface

Always get error with double inheritance help please
35 Replies
hercules_x_x
hercules_x_xOP3y ago
ero
ero3y ago
look at what the error says?
hercules_x_x
hercules_x_xOP3y ago
'Circle' does not implement interface member 'IShape_C.circumference()' [hw6]csharp(CS0535) why it cant
ero
ero3y ago
because it doesn't there is no circumference method in Circle
hercules_x_x
hercules_x_xOP3y ago
how to make it dose circumference?
ero
ero3y ago
add a method called circumference to Circle
hercules_x_x
hercules_x_xOP3y ago
but it must be done with constuctor that the teacher request
ero
ero3y ago
you already have a constructor that one is fine
hercules_x_x
hercules_x_xOP3y ago
ok ok guid me so i will add method
ero
ero3y ago
you need a method called circumference in Circle
hercules_x_x
hercules_x_xOP3y ago
ok ok wait
hercules_x_x
hercules_x_xOP3y ago
already
ero
ero3y ago
already what?
hercules_x_x
hercules_x_xOP3y ago
ohhhhh
ero
ero3y ago
i don't see a method called circumference
hercules_x_x
hercules_x_xOP3y ago
i see isee wrong type lol
hercules_x_x
hercules_x_xOP3y ago
work amazing
hercules_x_x
hercules_x_xOP3y ago
thanks a lot ❤️
ero
ero3y ago
👍
hercules_x_x
hercules_x_xOP3y ago
btw any idea why cant use double inheritance with abstract got me confused
ero
ero3y ago
what do you mean?
hercules_x_x
hercules_x_xOP3y ago
or maybe can lol so there is abstract and interface
ero
ero3y ago
mhm
hercules_x_x
hercules_x_xOP3y ago
in abstract cant use double inheritance can i know why
MODiX
MODiX3y ago
Ero#1111
REPL Result: Success
interface I1 { }
interface I2 { }
abstract class C : I1, I2 { }
interface I1 { }
interface I2 { }
abstract class C : I1, I2 { }
Compile: 379.450ms | Execution: 30.491ms | React with ❌ to remove this embed.
ero
ero3y ago
you can
hercules_x_x
hercules_x_xOP3y ago
but for class I1 and I2 u still using interface
ero
ero3y ago
oh, yeah you can't inherit from 2 classes at once
hercules_x_x
hercules_x_xOP3y ago
abstract I1 { } abstract I2 { } abstract class C : I1, I2 { } can be like that
ero
ero3y ago
only 1 class and/or multiple interfaces
hercules_x_x
hercules_x_xOP3y ago
may i know why or no reason just like that
ero
ero3y ago
there's good reasons for that but i don't know enough to explain it well
hercules_x_x
hercules_x_xOP3y ago
ahh ok ok advance here i come lol thanks a lot for everything 🙏
bookuha
bookuha3y ago
Multiple inheritance caused many problem in the past So it was decided to move on interfaces and eliminate multiple inheritance in c# You have to always remember if there is no conflict caused by having similar member in your parent classes
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server