Objects in the rear view mirror ...

Been on a Java course this week, so far, I feel that 95% or more of the stuff is has encouraged me to appreciate that the dormant talent for Java programming is still there.

Yesterday, became quite surreal and metaphysical in programming terms. With the group discussing how objects could check other objects and how an object could become recursive and check itself to see if it is an object.

If you are lost at his point don't worry, I don't think that this has any practical value, but the notion of recursive* referencing of oneself to see if you is appealing to my sense of the absurd.

class object extends Object
{
    public void method (Object o)
    {
        if (o instanceof object)
        {
            System.out.println(o+" why");
        }
    }
}

public class myClass
{
    public static void main(String args[])
    {
        object anObject = new object();
        anObject.method(anObject);
    }
}
 *Recursion in this context is a computing function that calls itself repeatedly. An old joke in computing is "for recursion, see recursion".

Comments

Popular posts from this blog

Wikipedia editors never walk alone: Hillsborough changes can be traced ... from @ConversationUK

If airlines offer in-flight Wi-Fi, they should invest in an extra black box for security ...

Highlights and lowlights of 2014, a golden year for cybercrime from @ConversationUK