Telegram Group & Telegram Channel
Вопрос с собеседования

Можно ли переопределить private или static метод в Java?

Ответ: Нет, переопределить private и static методы нельзя, так как они не участвуют в механизме полиморфизма.

private-методы недоступны за пределами класса, поэтому при совпадении имени в подклассе создаётся совершенно новый метод, не связанный с исходным.

static-методы привязаны к классу, а не к объекту, и при наследовании могут быть скрыты, но не переопределены, поскольку их вызов определяется на этапе компиляции, а не во время выполнения.


tags: #собеседование

📱 Java Developer | Чат
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/java_tg/2936
Create:
Last Update:

Вопрос с собеседования

Можно ли переопределить private или static метод в Java?

Ответ: Нет, переопределить private и static методы нельзя, так как они не участвуют в механизме полиморфизма.

private-методы недоступны за пределами класса, поэтому при совпадении имени в подклассе создаётся совершенно новый метод, не связанный с исходным.

static-методы привязаны к классу, а не к объекту, и при наследовании могут быть скрыты, но не переопределены, поскольку их вызов определяется на этапе компиляции, а не во время выполнения.


tags: #собеседование

📱 Java Developer | Чат

BY Java Developer


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_tg/2936

View MORE
Open in Telegram


Java Developer Telegram | DID YOU KNOW?

Date: |

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Java Developer from in


Telegram Java Developer
FROM USA