Похожие чаты

I’ve seen this syntax used, but I’m not familiar with

it from any other language I know.
new SomeClass.SomeMemberOrSubClassIDontKnow () {
// code
}

What is this?
What is the name of this syntax pattern?

2 ответов

5 просмотров

there is an inner class in SomeClass

This is nested static class. In java docs they differentiate terms "inner" and "nested", and I may be intermixing them, but the real difference: one type is static, another ones are not. Static nested classes are used way much often. I can't remember that I've ever seen non-static ever in some real world projects. Assuming this is a *static* inner class, basically outer class serves as a namespace for the inner class. Nothing more. Examples: if (packet.type == SipPacket.Type.HANDSHAKE) { ... status = Http.Status.OK If you're talking about non-static inner classes (whatever they are officially called), this is another story

Похожие вопросы

Обсуждают сегодня

Вопрос по диагностике ошибок (я знаю в чем, в данном конкретном примере, я знаю, как исправить, пример модельный, понятно, что в реальности бывает намного запутаннее). module...
ⰄⰎⰋⰐⰐⰑⰛⰤⰧⰧⰩⰄ ⰊⰑⰁⰓⰡⰛⰦⰕⰫ
10
Asus, норм фирма для ноутов?
Артем Записной
20
И ещё - определить, имеет ли он доступ к интернету очень просто - смотрим всех пользователей сети. И да, как оно без сети передаст данные в куда то?
BytePixel 🐧
15
А чем вам питонисты не угодили?😂
.
79
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
48
Hey everyone! How can I pass string from Rust to c++ function that expects std::string? When I'm passing CString the c++ functions tell that the string is empty
Jacob
16
Ясн. Но я всеравно к кедам отношусь с опасением. Чисто субьективное кедосозерцание. Что касаемо "восторга изяшности кед" так и не вкурил, хотя много слышал, пока не поставил с...
Артем Записной
30
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
Есть предложения, как подобное можно упростить?
Hemul GM
12
type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
Карта сайта