Well according to some Stack Overflow question answers, I've read that using declaration of object inside the loop, is better than doing it outside of it, performance sided.
I could not understand why, because when I use the declaration inside the loop, my software uses more RAM then the one with the declaration outside of the loop.
while (true) {
String hey = "Hello.";
}
Ram usage: 1820kb
String hey;
while (true) {
hey = "Hello.";
}
Ram usage: 1720kb
Why people say that I should use the first loop cause its better for performance, yet it uses 100kb more from the ram?