Course Content‎ > ‎Session 5‎ > ‎

Final Classes

We may want to prevent a class from being further subclassed. A class that cannot be subclassed is called a Final class. This is achieved in Java by using the keyword final. Given below are the examples:
 
final class Aclass
{
..............
}
final class Bclass extends otherClass
{
..........
}  

Comments