Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Credentials used within multi classes

Status
Not open for further replies.

Xsi

Programmer
May 29, 2015
121
0
0
SE
Hello everyone,

Since I am new to java I am not sure if this is the right way of do this.

Anyway I have created following methods:

Java:
	public static String UserCredentials(String Username,String Password)
	{
	//Credentials for Terminal
		Username="Root";
		Password="Test1234";
		return Username+Password;
		
	}

and

Java:
	public static String UserCredentials(String Username,String Password)
	 {
		String Credentials=UserCredentials(null, null);
				
		 System.out.println(Credentials);
	 }

Since I am going to use the credentials within many different public class I am not sure how to do this really good.

I seen people are put inside a own public class
JAVA said:
public String password;
public String userName;


Please help me out

what is the best way of do this

Best Regards

Xsi


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top