https://kotlinlang.org logo
#random
Title
# random
g

Gleb Minaev

02/22/2023, 1:32 PM
Where do (or would) you put nullability annotations in Java? (1️⃣)
Copy code
@Notnull
public static String foo() { ... }
(2️⃣)
Copy code
public static @Notnull String foo() { ... }
1️⃣ 13
2️⃣ 1
r

rtsketo

02/22/2023, 1:44 PM
(3️⃣) K
g

Gleb Minaev

02/22/2023, 1:50 PM
@rtsketo, yeah, I would prefer Kotlin to Java too! But I am currently making slides about interop with Java. So I need to write an example involving Java code with the annotations.
b

Big Chungus

02/22/2023, 2:12 PM
Both options mean the same thing (return type) so it's just a matter of style/preference.
g

Gleb Minaev

02/22/2023, 2:16 PM
I know. I am literally asking what is the common style and whether there is one at all.
b

Big Chungus

02/22/2023, 2:16 PM
Ah, then deffo 1️⃣
6 Views