how to use same string in two java files

Posted by Palike on Stack Overflow See other posts from Stack Overflow or by Palike
Published on 2011-10-16T12:48:10Z Indexed on 2012/06/05 22:40 UTC
Read the original article Hit count: 180

Filed under:
|

Sorry for my bad English and for maybe stupid question but I'm new in Java.

I need use same string in 2 java files for example:

In first java file I've got code for sending emails, I've got string set to default email:

public String mail = new String ("[email protected]");

and I use this string in code for send email:

email.addTo(mail);

In second java file something like set up where can user set new email address I want to have same string, connected with string in first java file. When user put new email String mail will be change to new email address and in email.addTo(mail); will be use this new address

How can I do this?

© Stack Overflow or respective owner

Related posts about java

Related posts about string