<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cadrgtsecond.xyz/index.php?action=history&amp;feed=atom&amp;title=Cat_and_Dog_examples</id>
	<title>Cat and Dog examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cadrgtsecond.xyz/index.php?action=history&amp;feed=atom&amp;title=Cat_and_Dog_examples"/>
	<link rel="alternate" type="text/html" href="https://wiki.cadrgtsecond.xyz/index.php?title=Cat_and_Dog_examples&amp;action=history"/>
	<updated>2026-11-26T07:56:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://wiki.cadrgtsecond.xyz/index.php?title=Cat_and_Dog_examples&amp;diff=9&amp;oldid=prev</id>
		<title>Cadrgtsecond: Created page with &quot;A Cat and Dog example is an artificial example often inspired by real life objects used to teach programming, particularly Software Architecture, and particularly Object Oriented Programming  &lt;pre&gt; // Parent class class Animal{     void sound(){         System.out.println(&quot;Animal makes a sound&quot;);     } }  // Child class class Dog extends Animal{     @Override     void sound(){         System.out.println(&quot;Dog barks&quot;);     } }  // Child class class Cat extends Animal{...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.cadrgtsecond.xyz/index.php?title=Cat_and_Dog_examples&amp;diff=9&amp;oldid=prev"/>
		<updated>2026-11-25T12:37:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;A Cat and Dog example is an artificial example often inspired by real life objects used to teach programming, particularly Software Architecture, and particularly &lt;a href=&quot;/index.php?title=Object_Oriented_Programming&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Object Oriented Programming (page does not exist)&quot;&gt;Object Oriented Programming&lt;/a&gt;  &amp;lt;pre&amp;gt; // Parent class class Animal{     void sound(){         System.out.println(&amp;quot;Animal makes a sound&amp;quot;);     } }  // Child class class Dog extends Animal{     @Override     void sound(){         System.out.println(&amp;quot;Dog barks&amp;quot;);     } }  // Child class class Cat extends Animal{...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A Cat and Dog example is an artificial example often inspired by real life objects used to teach programming, particularly Software Architecture, and particularly [[Object Oriented Programming]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Parent class&lt;br /&gt;
class Animal{&lt;br /&gt;
    void sound(){&lt;br /&gt;
        System.out.println(&amp;quot;Animal makes a sound&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Child class&lt;br /&gt;
class Dog extends Animal{&lt;br /&gt;
    @Override&lt;br /&gt;
    void sound(){&lt;br /&gt;
        System.out.println(&amp;quot;Dog barks&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Child class&lt;br /&gt;
class Cat extends Animal{&lt;br /&gt;
    @Override&lt;br /&gt;
    void sound(){&lt;br /&gt;
        System.out.println(&amp;quot;Cat meows&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Driver class&lt;br /&gt;
public class Driver {&lt;br /&gt;
    public static void main(String[] args){&lt;br /&gt;
        Animal a = new Dog();&lt;br /&gt;
        a.sound();&lt;br /&gt;
        a = new Cat();&lt;br /&gt;
        a.sound();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other common examples include&lt;br /&gt;
* Various kinds of shapes&lt;br /&gt;
* Cars and Vehicles&lt;br /&gt;
&lt;br /&gt;
Of course, while these appear to be &amp;quot;real life examples&amp;quot;, they are completely silly and nothing like what we actually do in programming. And even in these examples, slight examination will lead one to discover members of the hierarchy such as &amp;lt;code&amp;gt;LandVehicleWithTwoWeels&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ShapeWithCorners&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AnimalsWithFurAndWarmBloodButWhichDoNotGiveLiveBirth&amp;lt;/code&amp;gt;. Complex inheritance hierarchies do not survive the complexities of real life.&lt;/div&gt;</summary>
		<author><name>Cadrgtsecond</name></author>
	</entry>
</feed>