Abstract:

child class access abstract class by using-->extends keyword.
Child class must implement all methods of abstract class.
Object class do not created object.

Hide implementation detail like real world example:bike ,car,tv etc.

In project sceanrio,used for design project

Syntax:

abstract class anyname{
    abstract void anymethodname();
}
          

college.java

abstract class college{
         abstract void branch();
		 }
          

sam.java

class sam extends college{
	public void branch(){
	    System.out.println("Sam selected computer science");
	}
}	

          

max.java

class max extends college{
	public void branch(){
		System.out.println("Sam selected Information Technology");
	}
}

          

test.java


class test{
  public static void main(String args[]){
     college c=new sam();
     c.branch();
	 college c1=new max();
	 c1.branch();
	}
}
          


OUTPUT:
Sam selected computer science
Sam selected Information Technology

          

Address

Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number:
8826034620