abstract method in Java

In java, a method is abstract by using abstract keyword.  
* Abstract methods may only be defined in abstract classes. If you want an abstract method, the class must also be abstract. You can't have an abstract method in a concrete class. Otherwise users could instantiate the class and try to implement its methods. However, if your class is abstract, it may have some methods that are abstract and others that are concrete.
* Abstract methods must not provide a method body. This is different from C++, while pure virtual function can have a body.
* Abstract methods may not be declared private or final.
* Implementing an abstract method in a subclass follows the same rules for overriding a method. The name and signature must be the same, and the visibility of the method in the subclass must be at least as accessible as the method in the parent class.

```
abstract class Sum{
   public abstract int sumOfTwo(int n1, int n2);
}

class Main extends Sum{
   public int sumOfTwo(int n1, int n2){
	return n1+n2;
   }

   public static void main(String args[]){
	Sum obj = new Main();
	System.out.println(obj.sumOfTwo(3, 7));
   }
}
```