Computer Science, asked by gaurinandni9730, 1 year ago

Why there are no global variables in Java?

Answers

Answered by sreeragm1999pbwcd0
0

Java doesn't support global variables, by design. Java was designed with object-oriented principles in mind and as such, every variable in Java is either local or a member of a class.


sreeragm1999pbwcd0: hope this helps you
Answered by shivamverma192345
0
hey friend!
Global variables are usually a design flaw.
you are components should be self contained and should not need any Global state instead use private static fields.

for more information you see on Google app store. ok

HOPE it helps you.

shivamverma192345: hey friend pls give me a thanks
shivamverma192345: if my answer is correct
shivamverma192345: pls
shivamverma192345: please
Similar questions