- Code: Select all
print "function 1"
print "function 2"
print "function 1 class2"
object1 = class1()
object2 = class2()
In the above example 'object2' is able to call the 'function1' method from its super class because it is part of the 'function1' method inside 'class2'.
What i would like to know is if it is possible for 'object2' to call 'function1' from 'class1' from inside the 'main' function without making it an explicit method first.
I have attempted to do achieve this using the line of code which is commented out. Hopefully you will know what I'm trying to say once you've looked at it.
Is what I'm trying to do possible or is this impossible for security issues I don't fully understand yet? (novice programmer here)
Thanks in advance