Section 1

Preview this deck

What is a delegate in C#

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (11)

Section 1

(11 cards)

What is a delegate in C#

Front

A reference pointer to a method.....just like an object variable is a reference to an object, a delegate is a reference to a method.

Back

Why do we use the @override annotation above a method we want to override.

Front

The compiler will throw an error for you if you put the annotation. You can catch errors.

Back

Can overloaded methods be in the same class?

Front

Yes. They can also be in subclasses.

Back

What does polymorphism mean?

Front

A supertype variable can refer to a subtype object.

Back

Before downcasting an object, what keyword should you use?

Front

instanceof if(object instanceof Circle)

Back

What is implicit object casting?

Front

When an object is assigned to a superclass reference...e.g. Object o = new Student(); Student is always a type of Object.

Back

What is method overloading?

Front

Defining multiple methods with the same name but different signatures.

Back

When comparing two objects, what does == do?

Front

It checks if the two object variables point to the same object, or basically it compares the references.

Back

What is method overriding?

Front

Overriding is providing a new implementation for a superclass method in a subclass

Back

What is explicit object casting?

Front

Student b = (Student)o; It's usually used when downcasting because the compiler doesn't know that the if the supertype is a type of the subtype. for instance....Object object = new Object(); object2 = (Circle)object;

Back

Can overridden methods be in the same class?

Front

No. They are in inherited classes.

Back