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: |

Telegram announces Anonymous Admins

The cloud-based messaging platform is also adding Anonymous Group Admins feature. As per Telegram, this feature is being introduced for safer protests. As per the Telegram blog post, users can “Toggle Remain Anonymous in Admin rights to enable Batman mode. The anonymized admin will be hidden in the list of group members, and their messages in the chat will be signed with the group name, similar to channel posts.”

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Java Developer from pl


Telegram Java Developer
FROM USA