+ 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
4 Answers
+ 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?
+ 4
This is kinda a bit too lazy. It's just a public keyword!!
+ 3
Too Lazy😂
+ 2
Martin Taylor yeah I Know, I'm just giving an example