constructor in abstract class (#29329)
Have added some information in abstract classes
This commit is contained in:
@ -46,7 +46,7 @@ Car carObj = new Car(); // valid
|
||||
Motorcycle mBikeObj = new Motorcycle(); // valid
|
||||
```
|
||||
|
||||
If the child class doesn't implement the abstract methods of the parent, it becomes an abstract class.
|
||||
If the child class doesn't implement the abstract methods of the parent, it becomes an abstract class. An abstract class can also contain constructors. A constructor of abstract class is called when an instance of a inherited class is created.
|
||||
|
||||
#### More Information
|
||||
- [Oracle Java Docs - Abstract Classes](https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.1.1)
|
||||
- [Oracle Java Docs - Abstract Classes](https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.1.1)
|
||||
|
Reference in New Issue
Block a user