Explain about global variables in Java?

Answer Posted / niranjanravi

Global variables are not possible in java because the
concept of Encapsulation is eliminated here.it is not in
the main() method where we declare variables.

Is This Answer Correct ?    5 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are wrapper classes in java?

820


what do you understand by the term string with respect to java?

801


how can you take care of mutual exclusion using java threads? : Java thread

838


What is the largest long allowed by java?

803


what is singleton in java?

820


What is the difference between actual and formal parameters?

726


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

1025


What are controls and their different types in awt?

860


Is math class static in java?

853


Define reflection.

766


How many bytes are a float?

727


What is scope & storage allocation of static, local and register variables? Explain with an example.

824


What is equals method in java?

767


what invokes a threads run() method? : Java thread

785


Name few java.lang classes introduced with java 8 ?

769