У нас вы можете посмотреть бесплатно Variable Shadowing and Variable Hiding или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Variable Shadowing : Same name of Loca variable nd Instance variable or class variable Variable Hiding: same name variable in Base class and Child class @HowToDo-g7m Q1. Which of the following is NOT a characteristic of variable hiding? a) Occurs when a variable in a subclass has the same name as a variable in the superclass. b) The subclass variable "shadows" the superclass variable. c) Can be resolved by using the super keyword. d) Only affects instance variables, not class variables. Answer: d) Explanation: Variable hiding applies to both instance and class variables (when they have the same name). Q2. In the context of variable hiding, which variable takes precedence within the subclass? (a) The superclass variable. 6 (b) The subclass variable. (c) Neither, an error occurs. (d) Both, they are accessed using the super keyword. Answer: (b) Q3. How can you access the hidden superclass variable within the subclass? (a) Using the this keyword. (b) Using the super keyword. (c) By simply using the variable name. (d) By declaring a new variable with the same name. Answer: (b)