Posts

Showing posts with the label create and delete file

Java File Class जावा फाइल क्लास

The File class in Java is part of the java.io package and is used to represent the path of files and directories. The File class does not read or write data directly; it only provides information about files and directories and methods to create, delete, or check properties. जावा में File क्लास java.io पैकेज का हिस्सा है और इसका प्रयोग फाइल एवं डायरेक्टरी के पाथ को प्रदर्शित करने के लिए किया जाता है। File क्लास डेटा को सीधे पढ़ती या लिखती नहीं है; यह केवल फाइल और डायरेक्टरी की जानकारी और उन्हें बनाने, हटाने या चेक करने की सुविधा देती है। 🔹 Constructors of File Class (कन्स्ट्रक्टर्स) File(String pathname) – Creates a new File instance using a given pathname. File(String pathname) – दिये गये पाथनेम के आधार पर नई File ऑब्जेक्ट बनाता है। File(String parent, String child) – Creates a File object from directory and filename separately. File(String parent, String child) – डायरेक्टरी और फाइल का नाम अलग-अलग देकर File ऑब्जेक्ट बनाता है। 🔹 Common Methods of Fil...