Create any file & save it with .properties extension For example - Add new file in eclipse By right click on project > New > Fille and add below properties.
Username = xyz
Password = 123
Write Below code to access this file
String filepath = "./config.properties" ; // Path of .properties file
File f = new File(filepath);
FileInputStream fs = new FileInputStream(f);
Properties pro = new Properties();
Pro.Load(fs);
pro.getProperty("Username"); // return value "xyz" return type string
pro.getProperty("Password"); // retun value "123" return type string
Also, use-
driver.findelement(By.id("user")).sendKeys(pro.getProperty("Username"));
driver.findelement(By.id("pass")).sendKeys(pro.getProperty("Password"));