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

How can we include images in a web page using html and java, How can we inc...

How can we include images in a web page using HTML and Java script? Image in HTML Image in Javascript Images in JavaScript could be manipulated in several ways using the buil

Write a program that manages a list of train tickets, A fictitious train co...

A fictitious train company, 'Transrail', has commissioned you to write a program that manages a list of train tickets. The program should display a text menu that prompts the us

Want a script developer, I want a Script developer who will make script for...

I want a Script developer who will make script for me and if you can show good works there are bonuses too. Skills required are Facebook Marketing, Java, Javascript, PHP, and Sc

Illustrate jdbc, JDBC stands for Java Database Connectivity: It is an ...

JDBC stands for Java Database Connectivity: It is an API which gives easy connection to a wide range of databases. To connect to a database we have to load the appropriate dri

Java web services, #quThis project is based on the teams example of chapter...

#quThis project is based on the teams example of chapter 1. Instead of teams, you will consider employees working in a department in a company. (Departments and employees are ana

Describe remote objects?, Describe Remote Objects A Remote Object is o...

Describe Remote Objects A Remote Object is one whose functions can be called from another JVM. A remote object class must execute the Remote interface. A RMI Server is an appl

Minimum shelfs, send me the java code for minimum shelf program

send me the java code for minimum shelf program

RatinalAssignment, 1. Make a class Rational to provide at least following m...

1. Make a class Rational to provide at least following methos and constructors: Rational r1= new Rational (3,5); Rational r2= new Rational (4,7); Rational r3=r1.add(r2);

Explain any five buzz words in java, Question 1 Explain any five buzz word...

Question 1 Explain any five buzz words in Java Question 2 Explain exception classes and also explain common exceptions in java Question 3 Explain primitive and abstract data t

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