17 Replies
@alex here is good?
my first question whats the difference between an interface and an abstract class other than the fact the interface makes everything abstract by default
a class can implement many interfaces but can only inherit from one class
abstract classes can have state, interfaces can't
ok jimmacle
and an interface by defauly
makes everything abstract
right?
sort of
not really anymore with default interface implementations
cant i use any constructor
to create an object
in a concrete class
i dont get the static constructor part
or is that part of my vision
static constructors run once automatically when your class is first used
oh
so the default constructor
right?
why here
do i do public void method1() {}
or
public override void method 1() {}
no, static constructor is specified static
static MyClass() { }
look up the warning code?ok i got it
basically if u implement smth from an abstract class
inherit*
u need to either make the method abstract again
or make it concrete and override it
correct
what if i make abstract method in class A
then i make the same abstract method in Class B
will i need to override it
or nah
public abstract void method() in class A
public abstract void method() in Class B
Is that correct
it doesn't make sense to redefine it
So what will be the correct syntax
If I left it as abstract
In the derived class
you just don't redeclare it
it's already being inherited from A
but if you leave it abstract you'll also have to declare class B abstract too