Understanding instanceof in java along with if condition?
===

    >>
 I am not sure how the tree (refernce variable) became isntance of object Tree in 
my below sample program? I am expecting "Pine" and "oops" as output but why "Tree" is included in output? I havent given Tree tree = new Tree() at all. 

        class Tree{}  
    class Pine extends Tree{}  
    class Oak extends Tree{}  
    public class forrest {    
 
    	public static void main( String[] args )      
    	{    
    		Tree tree = new Pine();   
		
		
     		if( tree instanceof Pine )      
    			System.out.println( "Pine" );   
    		if( tree instanceof Tree )       
    			System.out.println( "Tree" );  
    		if( tree instanceof Oak )      
    			System.out.println( "Oak" );   
    		else System.out.println( "Oops" );  
    	}  
    }