Properties হল Hashtable ক্লাসের একটি সাবক্লাস এবং এটি প্রোপার্টিজের একটি স্থায়ী সেট উপস্থাপন করে। Properties একটি স্ট্রিমে সংরক্ষণ করা যেতে পারে বা একটি স্ট্রিম থেকে লোড করা যেতে পারে। প্রপার্টি লিস্টে প্রতিটি কি এবং এর সংশ্লিষ্ট ভ্যালু একটি স্ট্রিং।
Properties ফাইল জাভাতে কনফিগারেশন এক্সটার্নালাইজ করতে এবং কি-ভ্যালু পেয়ার সংরক্ষণ করতে ব্যবহৃত হয়। Properties.load() মেথড Properties ক্লাসের .properties ফাইলকে কি-ভ্যালু পেয়ার-রূপে লোড করার জন্য সুবিধাজনক।
সিনট্যাক্স
public class Properties extends Hashtable
credentials.properties ফাইল

উদাহরণ
import java.io.*;
import java.util.*;
public class ReadPropertiesFileTest {
public static void main(String args[]) throws IOException {
Properties prop = readPropertiesFile("credentials.properties");
System.out.println("username: " + prop.getProperty("username"));
System.out.println("password: " + prop.getProperty("password"));
}
public static Properties readPropertiesFile(String fileName) throws IOException {
FileInputStream fis = null;
Properties prop = null;
try {
fis = new FileInputStream(fileName);
prop = new Properties();
prop.load(fis);
} catch(FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch(IOException ioe) {
ioe.printStackTrace();
} finally {
fis.close();
}
return prop;
}
}
আউটপুট
username: admin password: admin@123