 <p>Here is an example. Suppose we have 2 classes:</p> <pre><code>class A { public String getName() { return "A"; } } class B extends A { public String getName() { return "B"; } } </code></pre> <p>If we now do the following:</p> <pre><code>public static void main(String[] args) { A myA = new B(); System.out.println(myA.getName()); } </code></pre> <p>we get the result</p> <pre><code>B </code></pre> <p>If Java didn't have <code>virtual method invocation</code>, it would determine at compile time that the <code>getName()</code> to be called is the one that belongs to the <code>A</code> class. Since it doesn't, but determines this at runtime depending on the actual class that <code>myA</code> points to, we get the above result.</p> <p><strong>[EDIT to add (slightly contrived) example]</strong><br> You could use this feature to write a method that takes any number of <code>Object</code>s as argument and prints them like this:</p> <pre><code>public void printObjects(Object... objects) { for (Object o: objects) { System.out.println(o.toString()); } } </code></pre> <p>This will work for any mix of Objects. If Java didn't have <code>virtual method invocation</code>, all Objects would be printed using Object´s <code>toString()</code> which isn't very readable. Now instead, the <code>toString()</code> of each actual class will be used, meaning that the printout will usually be much more readable.</p>