-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
JetBrains releases IntelliJ IDEA 2025.1.1, bringing multiple bug fixes and improvements
By David Uzondu,
- jetbrains
- intellij idea
- (and 6 more)
- 0 replies
- 0 views
-
- 14 replies
- 0 views
-
High Performance with Java ($33.99 Value) free eBook download
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 4 views
-
- 0 replies
- 8 views
-
Java and Algorithmic Thinking for the Complete Beginner ($9.99 Value) free download
By News Staff,
- ebook offer
- sponsored
- (and 1 more)
- 0 replies
- 4 views
-
Question
SirEvan
This is probably a really noobish question, but I don't know what to type in google to find the answer.
Is there a benefit performance or memory usage wise by doing the following:
final String dayOfTheWeek = String.valueOf(Globals.DayFormat.print(new DateTime()));[/CODE]
Instead of:
final DateTime dt = new DateTime();
final String dayOfTheWeek = String.valueOf(Globals.DayFormat.print(dt));[/CODE]
basically saving declaring the first variable and then using it in the second line? Or does it not really matter? I know variable declaration is costly, but not sure if doing the first thing is the equivalent of the second.
Link to comment
https://www.neowin.net/forum/topic/1157436-any-performance-benefits-to-using-object-inline-instead-of-declaring-a-vari/Share on other sites
2 answers to this question
Recommended Posts