Рассмотрим следующий Java-файл, в котором объявлены два класса — Library и Escape. Обратите внимание: класс Escape имеет package-private доступ, так как у него нет явного модификатора доступа:
// internal/Library.java package internal;
public interface Library { static Escape create() { return new Escape(); } }
class Escape {}
Следующая программа использует оба класса, но из другого пакета. При этом она не ссылается напрямую на класс Escape по имени — и успешно компилируется и выполняется без ошибок:
void main() { Object a = internal.Library.create(); IO.println(a);
var b = internal.Library.create(); IO.println(b);
Object c = internal.Library.create(); IO.println(c.toString()); // обратите внимание на вызов toString() }
Но если последнюю переменную c тоже объявить с использованием var, как здесь:
var c = internal.Library.create();
то компиляция завершится ошибкой:
"Object.toString() is defined in an inaccessible class or interface"
Рассмотрим следующий Java-файл, в котором объявлены два класса — Library и Escape. Обратите внимание: класс Escape имеет package-private доступ, так как у него нет явного модификатора доступа:
// internal/Library.java package internal;
public interface Library { static Escape create() { return new Escape(); } }
class Escape {}
Следующая программа использует оба класса, но из другого пакета. При этом она не ссылается напрямую на класс Escape по имени — и успешно компилируется и выполняется без ошибок:
void main() { Object a = internal.Library.create(); IO.println(a);
var b = internal.Library.create(); IO.println(b);
Object c = internal.Library.create(); IO.println(c.toString()); // обратите внимание на вызов toString() }
Но если последнюю переменную c тоже объявить с использованием var, как здесь:
var c = internal.Library.create();
то компиляция завершится ошибкой:
"Object.toString() is defined in an inaccessible class or interface"
Telegram is a leading cloud-based instant messages platform. It became popular in recent years for its privacy, speed, voice and video quality, and other unmatched features over its main competitor Whatsapp. On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information. How to Create a Private or Public Channel on Telegram? Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins.
from us