Downcasting with instanceof Operator
<p>Downcasting is when child class refers to the object of Parent class. I tried doing it without the instanceof operator.</p>

<pre><code>class Food { }  
class bread4 extends Food {  
  static void method(Food a) {  
       bread4 b=(bread4)a;
       System.out.println("ok downcasting performed");  
  }  
   public static void main (String [] args) {  
    Food a=new bread4();  
    bread4.method(a);  
  }  
}  
</code></pre>

<p>Can anyone help me in this by using instanceof operator?</p>