class A
{
}
class B{
void me()
{
System.out.println(“hello you are inside B’s me method”);
}
}

Class C
{
public static void main(String a[])
{
A a=new B();
d.me();
}
}



A  d                       =                                 new B();

Referencing                                  create a memory for a object of type B




Here d is a veriable of class A and pointing to a memory  of type class B.
d.me()
here d check the body of me() method inside the A class wheather it be blank doesn’t metter but it should be .
if it doesn’t  find  then it gives error at compile time.
When program becomes successful compiled then at runtime it goes to the memory of type B and search there about method me()


constructor



class One
{
  One()
{
   System.out.println("One");
}
}
class Two extends One
{
   Two()
{
   System.out.println("Two");
}
}
class Super2
{
   public static void main(String args[])
{
   Two t=new Two();
}
}




The first  line of every constructor is 
super();
that is every constructor call its super class constructor  first;






Abstract



Abstract method: abstract method is a method which doesn’t  contains body in that class where it declares. Definitely It has a body in that class in which it becomes inherited .It may or may not has keyword  “abstract” when is declared in a interface but has keyword “abstract” when it becomes declared inside a abstract class .every  concrete class has a body( at least  empty body) of every abstract method to which concrete class keeping inherit
Abstract class:  every class which starts with “abstract” keyword and contained atleast one abstract method is known a abstract class it may has concrete method.  we   can’t  make instance of abstract class.
We can call constructor of abstract class using child class’s constructor since every constructor of class has  super() in its first line which calls the super class constructor.
Interface: interface is just like class but it it is created using interface keyword. Interface has all its method abstract by default and final field by default. Fields should be declared and initialized in same line.



  

Counters