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;