Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 3: Important Questions

Lesson 25 of 36 in the free Web Based Programming notes on Siksha Sarovar, written by Rohit Jangra.

Important Questions: Unit 3 – File Handling & OOP

Short Answer Questions (2-5 Marks)

  1. What is the difference between include() and require() in PHP?
  2. List any four file open modes in PHP with their descriptions.
  3. What is Object-Oriented Programming (OOP)? Name four core principles of OOP.
  4. What are access modifiers in PHP? Explain public, protected, and private with a comparison table.
  5. What is a constructor in PHP? How does it differ from a destructor?
  6. Define Encapsulation and Inheritance with one example each.

Long Answer Questions (10-15 Marks)

  1. Explain PHP File Handling in detail. Describe fopen(), fread(), fwrite() and fclose() with their modes and code examples.
  2. Explain the concept of Classes and Objects in PHP. Discuss: Class definition, Object creation, Properties, Methods, the $this keyword, Constructor, and Destructor. Include a complete code example.
  3. Discuss Inheritance in PHP. Explain the types of inheritance supported (Single, Multilevel, Hierarchical), the extends keyword, method overriding, and the final keyword. Provide examples.
  4. Describe the file uploading process in PHP step-by-step, covering the HTML form, the $_FILES superglobal, and the move_uploaded_file() function.