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

Почему в Java интерфейс может иметь методы с реализацией (default)? Это не противоречит идее интерфейса?

Ответ: Нет, не противоречит. Они нужны, чтобы можно было добавлять новые методы в интерфейс, не ломая старые классы, которые уже его реализуют.

Без default при добавлении нового метода пришлось бы менять весь существующий код. С default-методом интерфейс даёт базовую реализацию метода, которую необязательно переопределять в реализующих классах.


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

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



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

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

Почему в Java интерфейс может иметь методы с реализацией (default)? Это не противоречит идее интерфейса?

Ответ: Нет, не противоречит. Они нужны, чтобы можно было добавлять новые методы в интерфейс, не ломая старые классы, которые уже его реализуют.

Без default при добавлении нового метода пришлось бы менять весь существующий код. С default-методом интерфейс даёт базовую реализацию метода, которую необязательно переопределять в реализующих классах.


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/2878

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Telegram hopes to raise $1bn with a convertible bond private placement

The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.

Can I mute a Telegram group?

In recent times, Telegram has gained a lot of popularity because of the controversy over WhatsApp’s new privacy policy. In January 2021, Telegram was the most downloaded app worldwide and crossed 500 million monthly active users. And with so many active users on the app, people might get messages in bulk from a group or a channel that can be a little irritating. So to get rid of the same, you can mute groups, chats, and channels on Telegram just like WhatsApp. You can mute notifications for one hour, eight hours, or two days, or you can disable notifications forever.

telegram from us


Telegram Java Developer
FROM USA