Читать книгу OCP Oracle Certified Professional Java SE 17 Developer Study Guide - Jeanne Boyarsky - Страница 69

Optional Modifiers in main() Methods

Оглавление

While most modifiers, such as public and static, are required for main() methods, there are some optional modifiers allowed.

public final static void main(final String[] args) {}

In this example, both final modifiers are optional, and the main() method is a valid entry point with or without them. We cover the meaning of final methods and parameters in Chapter 6.

OCP Oracle Certified Professional Java SE 17 Developer Study Guide

Подняться наверх