Lecture 43 File class in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

FAQs on Lecture 43 File class in Java Hindi Video Lecture - Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

1. File class क्या है?
Ans. File class जावा में एक built-in class है जो फ़ाइल और डायरेक्ट्री को represent करने के लिए इस्तेमाल होती है। यह class फ़ाइल्स को create, delete, rename, और modify करने के लिए तरीके प्रदान करती है।
2. File class के कुछ महत्वपूर्ण मेथड कौन-कौन से हैं?
Ans. File class कुछ महत्वपूर्ण मेथड हैं: - exists(): यह method द्वारा चेक किया जा सकता है कि एक फ़ाइल या डायरेक्ट्री मौजूद है या नहीं। - createNewFile(): इस method के द्वारा एक नई फ़ाइल create की जा सकती है। - delete(): यह method एक फ़ाइल या डायरेक्ट्री को delete करने के लिए इस्तेमाल होता है। - renameTo(File dest): इस method के द्वारा एक फ़ाइल का नाम बदला जा सकता है। - isDirectory(): यह method द्वारा एक फ़ाइल या डायरेक्ट्री के बारे में जानकारी मिलती है कि वह एक डायरेक्ट्री है या नहीं।
3. File class का उपयोग किस तरह से किया जाता है?
Ans. File class का उपयोग इस्तेमालकर्ता के द्वारा फ़ाइल्स और डायरेक्ट्री को create, delete, rename, और modify करने के लिए किया जाता है। इसका प्रयोग किसी भी प्रकार की फ़ाइल सिस्टम ऑपरेशन के साथ किया जा सकता है, जैसे कि फ़ाइल की मौजूदगी की जांच करना, नई फ़ाइल बनाना, फ़ाइल को डिलीट करना, फ़ाइल का नाम बदलना, आदि।
4. File class के निर्माण से जुड़े कुछ उदाहरण बताएं।
Ans. कुछ File class के उदाहरण हैं: - एक नई फ़ाइल बनाना: ``` File file = new File("example.txt"); file.createNewFile(); ``` - फ़ाइल की मौजूदगी की जांच करना: ``` File file = new File("example.txt"); if (file.exists()) { System.out.println("File exists"); } else { System.out.println("File does not exist"); } ``` - फ़ाइल को डिलीट करना: ``` File file = new File("example.txt"); file.delete(); ``` - फ़ाइल का नाम बदलना: ``` File file = new File("oldname.txt"); File newFile = new File("newname.txt"); file.renameTo(newFile); ```
5. File class किस पैकेज में होती है?
Ans. File class "java.io" पैकेज में होती है। इस पैकेज में फ़ाइल और इनपुट-आउटपुट (input-output) के साथ संबंधित अन्य क्लासेस भी होती हैं।
Related Searches

Lecture 43 File class in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

,

Previous Year Questions with Solutions

,

past year papers

,

shortcuts and tricks

,

Semester Notes

,

Exam

,

Sample Paper

,

pdf

,

practice quizzes

,

study material

,

Free

,

Extra Questions

,

Lecture 43 File class in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

,

MCQs

,

Viva Questions

,

Important questions

,

Summary

,

Objective type Questions

,

video lectures

,

ppt

,

mock tests for examination

,

Lecture 43 File class in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

;