Following are the uses of super keyword: To refer the immediate super class constructor To refer the immediate super class members Refer super class constructor: The super keyword can be used to invoke the constructor of its immediate super class and pass data to it. Syntax for doing so is given below: super(parameters-list); When writing the above statement inside the constructor of the derived class, it must be the first line. It is a mandatory requirement. For understanding how this works, let’s consider our previous example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
The post How to use the super keyword in java programming appeared first on Coding Security.
How to use the super keyword in java programming
read more
Tidak ada komentar:
Posting Komentar