« Previous day (Jul 1, 2008) | Main | Next day (Jul 3, 2008) »
 20080702 Wednesday July 02, 2008

Netbeans 6.1 Editor - One Of My Favorite Shortcuts / "Hidden" Functionalities

Netbeans 6.1 is able to automatically assign a return value and create a variable for you. This is really convenient. To try it out do the following:

  1. Type e.g. new java.util.Date();  (or new Date() with strg+space -> it will import it for you), or invoke an arbitrary method with a return value (e.g toString()).
  2. Then go with the cursor to Date()  (or the method).
  3. You should see a yellow bulb on the left. Either click on the bulb, or click alt+enter.
  4. Netbeans should suggest you: "Assign Return Value To New Variable" just press Enter.
  5. Netbeans will create a variable, derive the name and the type. The end result is:  Date date = new Date();
Small thing - but safes time. Gesendet von admin [Netbeans] ( July 02, 2008 12:02 PM ) Permalink | Kommentare [3]
[my website] [This entry is based on / extends my books: Enterprise Architekturen, Leitfaden fuer effiziente Software-Entwicklung and: Java EE 5 Architekturen, Patterns und Idiome]




License
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.0 License.