Java public block | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

Java public block

Hello PROgrammersšŸ‘€ Is there any way change all my global-variable to public just by using {}... Or something like that? For example... public { int age; String name; double height; } Where it's makes all the inside variables to public... instead of adding the keyword "public" for every single variables? Inserd of like this... public int age; public String name; public double height; Thanks! Happy coding

2nd May 2020, 4:37 PM
KingDaniel2004
KingDaniel2004 - avatar
4 Respostas
+ 4
This kind of thing is only present in the Cs as far as I remember. Plus it's just one word. What's the hassle?
2nd May 2020, 4:40 PM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
+ 4
This is kinda a bit too lazy. It's just a public keyword!!
2nd May 2020, 4:43 PM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
+ 3
Too LazyšŸ˜‚
2nd May 2020, 4:42 PM
KingDaniel2004
KingDaniel2004 - avatar
+ 2
Martin Taylor yeah I Know, I'm just giving an example
2nd May 2020, 5:49 PM
KingDaniel2004
KingDaniel2004 - avatar