In programming, I often have situations where I want to print a variable to the console.
int myVar = 23;
System.out.println("myVar" + myVar);
I'd like to automate the task by outsourcing it to an Eclipse template. So far, this is the template I have prepared:
System.out.println((NAME OF VAR IN QUOTES?) + ${var});
How would I put the name of var in a String?
You are very close. It's just easy as that:
System.out.println("${var} " + ${var}); // quote creates the difference
I use:
System.out.println("${var}:\t" + ${var});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With