W
W
WannaCreative2016-09-25 18:40:17
Java
WannaCreative, 2016-09-25 18:40:17

What is the best String to use?

String name = "Dan";
Or

public static String name()
{
         String myName = "Dan";
         return myName;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-09-25
@miraage

This function is an example Referential Transparency.
When they are needed, and when not - read for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question