refernce variable pointing to another object : There is an interface with Named Bank and it has two implementing classes Named ABC and XYZ and there is a main method 
 public class Tester2 {  	public static void main(String[] args) { 
		// i/f ref can directly refer to ANY concrete imple cls instance 		Bank ref = new ABC();// up casting 	
	ref.withdraw(123, 345);//DMD 	
	// ref.payBills(); 		((ABC) ref).payBills(); 
		ref = new XYZ(); 	
	if (ref instanceof ABC) 			((ABC) ref).payBills(); 		else 			System.out.println("Wrong Bank!!!!"); 	}  } so my question is Now ref has type ABC and the value of ref is overriden by XYZ.so how can the instance of ref be ABC