Pages

December 15, 2020

12/15/2020:

The woman working with Tech Elevator on supportive services emailed me today, asking for my monthly bills. She said no promises but she might be able to find me other help while I wait for CHN Housing to respond to my application. I don't really expect CHN Housing to respond, now they're out of pandemic funds, but who knows. Since I'm no longer receiving unemployment, my income is now zero so they might. 

------------------------------------------------------------------------------------------ 

I'm still a day behind on outlining my homework reading, but I was able to complete both that and my homework problems during lecture again today. We're working on Polymorphism, which is connected to inheritance in that you can connect to either a parent or child class method, depending on how you cast the object accessing the method.

So say you have a clock Class, with subclasses of grandfatherClock and cuckooClock. Say you then have a shopkeeper Class, who is in charge of setting the time for all the clocks. You don't want to have separate methods to set the time for each clock type. Since grandfatherClock IS A clock, and cuckooClock IS A clock, you can create a single method in the shopkeeper Class that sets the time for a clock object. GrandfatherClock and cuckooClock, as subclasses of clock, have access to the setTime() method in clock. 

Polymorphism is also where we learned about Interfaces, because you can cast an object to be referred to as having implemented the interface. An alarmClock and a phone both have alarms, but are not the same type of object. A phone is not derived from alarm clock, and neither is an alarm clock derived from a phone. With an Alarmable interface, you can cast either as Alarmable so shopkeeper can access the setAlarm() method they both have implemented as part of the Alarmable contract.

------------------------------------------------------------------------------------------ 

Accomplishments:
13K+ Steps
Finish drying, folding, and putting away clothes
Clean 2nd floor bathroom
Watch The Voice finale

No comments: