Home >Java >javaTutorial >Final class in Java

Final class in Java

PHPz
PHPzforward
2023-09-12 10:01:02776browse

Final class in Java

#The main purpose of using a class declared as final is to prevent the class from being subclassed. If a class is marked final, no class can inherit any features from the final class.

public final class Test {
   // body of class
}

The above is the detailed content of Final class in Java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete