Why local variable is preferred over global variable, JAVA Programming

Assignment Help:

Why Local variable is preferred over Global variable ?

In my point of view Global variable has a few advantage along with Local variables is preferred because of the subsequent reasons:-
When we declare any global variable within web page then in case of error and logic it's extremely difficult to see on that line this variable is used and what's his value if we have more than 2000 lines and all the functions in web page using that Global Variable so Global variables could form the logic of a Web page hard to understand.

As we know we can use Global variable everywhere so global variables also form the reuse and manages of your code much more complex.


Related Discussions:- Why local variable is preferred over global variable

Swing, can we develop paint user can draw his charcters and images in swing...

can we develop paint user can draw his charcters and images in swing

Decsion tree, implementation of DT in netbeans

implementation of DT in netbeans

Difference between while statement and a do while statement, What is the di...

What is the difference between a while statement and a do while statement? A while statement checks at the starting of a loop to see whether the next loop iteration should occu

Web-based application, Web-based Application: CIA - OMP Type     ...

Web-based Application: CIA - OMP Type                                         Web-based Application Role                                          Weblogic Administrato

Control structures, JavaScript supports the normal control structures: ...

JavaScript supports the normal control structures: The conditionals if, if...else, & switch; The iterations for, while, do...while, break, & continue;

Java project illustrate sequential and selection programming, This project ...

This project focuses on demonstrating the understanding of data types, input/output, sequential and selection programming statements, and mathematical operations. The project re

Method over ridding method in java, Q. Write short on the method over riddi...

Q. Write short on the method over ridding method in java? Ans. Method over ridding and dynamic binding: We have seen that a method in a super class is inherited by its subclass

What does a simple spring application contain, These applications are like ...

These applications are like any Java application. They are made up of not many classes, each performing a particular purpose within the application. But these classes are configure

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd