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

Reviewing Scope

Оглавление

Got all that? Let's review the rules on scope:

 Local variables: In scope from declaration to the end of the block

 Method parameters: In scope for the duration of the method

 Instance variables: In scope from declaration until the object is eligible for garbage collection

 Class variables: In scope from declaration until the program ends

Not sure what garbage collection is? Relax: that's our next and final section for this chapter.

OCP Oracle Certified Professional Java SE 17 Developer Study Guide

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