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

75 videos

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) के साथ संबंधित अन्य क्लासेस भी होती हैं।
75 videos
Explore Courses for Back-End Programming exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

practice quizzes

,

video lectures

,

Extra Questions

,

past year papers

,

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

,

Important questions

,

study material

,

ppt

,

Viva Questions

,

Summary

,

Free

,

Previous Year Questions with Solutions

,

mock tests for examination

,

Semester Notes

,

Sample Paper

,

MCQs

,

Exam

,

shortcuts and tricks

,

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

,

Objective type Questions

,

pdf

,

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

;