-3

How can I change a particular variable to some other throughout the whole program?

For example, I have made an array L which has quantity, and I want to switch L with qty throughout the program!

Find and replace will take forever. Any other method that I can use here?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
ibuprofen
  • 117
  • 6
  • Because brother SO community believe first you should find your answer by searching and trying at your end. When you do not find appropriate answer or solution, then ask help from community. Rest everybody is here to help each other. :-) – Aman Aug 23 '17 at 12:01
  • This does not deserve the downvotes, since most pages do not say `change variable name in program`. He just didn't know the term – mid Aug 23 '17 at 12:02
  • Which IDE are you using? The answers will depend heavily on that. It is not be possible with every IDE. You could possibly also use a command-line tool, especially if the variable name's text appears nowhere other than when used as the variable name - that would make this question very broad (too broad). – Bernhard Barker Aug 23 '17 at 12:17
  • 1
    @Midnightas This question does not show any research effort and is underspecified - downvotes seem justified. – Bernhard Barker Aug 23 '17 at 12:19
  • @Dukeling I am using BlueJ – ibuprofen Aug 23 '17 at 12:30
  • @Midnightas What is the technical term then? – ibuprofen Aug 23 '17 at 12:30
  • @LinuxGeek refactoring – mid Aug 23 '17 at 12:32
  • I don't believe you can do this in BlueJ, but then I haven't used it in like a decade (someone else might be sure enough to post an answer). This can be done in both NetBeans and Eclipse, which are often recommended if you're looking for a feature-rich IDE. – Bernhard Barker Aug 23 '17 at 13:00
  • @Dukeling I just installed Eclipse. It feels like a huge drift compared to the basic BlueJ – ibuprofen Aug 23 '17 at 15:44

1 Answers1

0

Just open your project in eclipse and use inbuilt "refactor" mechanism of eclipse IDE.

Aman
  • 735
  • 1
  • 6
  • 19