Object Oriented Programming Implementation 1. How are properties different from
ID: 3710749 • Letter: O
Question
Object Oriented Programming Implementation
1. How are properties different from methods?
2. When you retrieve an integer from a collection and modify the integer, what happens to the
corresponding integer stored in the collection? How is this different from retrieving and modifying an
object?
3. What happens to an object created inside a procedure when the procedure finishes?
4. When a property procedure or method in a base class is not appropriate for a derived class, what can
you do?
5. Suppose class B is derived from class A. Class A’s UpdateData method has been over- ridden in class B.
How can the UpdateData method in class B call the UpdateData method in class A?
6. Why are member variables usually declared Private in classes?
7. At the end of the following example, how many Student objects exist?
Dim st1 As New Student
Dim st2 As Student
st2 = st1
8. At the end of the following example, how many Student objects exist?
Dim st1 As New Student
Dim st2 As Student
st2 = st1
st1 = Nothing
9. Suppose that an application at an animal hospital uses two classes: Mammaland Dog. Which do you think
is the base class and which is the derived class? Why?
10. Why does it make sense that you cannot use the Overridable keyword in a private base class
member declaration?
Explanation / Answer
1. How are properties different from methods?
Answer)
In object oriented programming a property is a way of expressing some object property where reads and writes are translated to getter and setter methods. So properties are a useful feature of expressing the feature that an object has, where the property of the object can accessed by dot notation as object.property.
A method is a function or procedure which handles the data and objects to provide some specific operation and returning the output. A method may or may not have arguments and also it may or may not return some data. A method performs some specific operation or work and returns the value after the work is completed and the changes made.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.