- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between declaring a variable before or in a Java loop.
Performance wise, there is hardly any difference. But it is good to keep a variable local to the scope it is used. So declaring a variable inside Java loop is generally preferred.
- Related Articles
- What is the difference between Declaring and Initializing a variable in JavaScript?
- Can re-declaring a variable destroy the value of that variable in JavaScript?
- Must you define a data type when declaring a variable in JavaScript?
- Restrictions while declaring a generic (type) in Java
- Difference between for loop and while loop in Python
- Can a method throw java.lang.Exception without declaring it in java?
- Difference between Open Loop and Closed Loop Control System
- Difference Between for and while loop
- Difference Between Identifier and Variable
- Declaring a Fallback Color in CSS
- Can I use a JavaScript variable before it is declared?
- Difference Between while and do-while Loop
- What is the difference between a variable and StringVar() of Tkinter?
- Difference Between Local and Global Variable
- What are the differences between while loop and do-while loop in Java?

Advertisements