[ PHP Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ PHP Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
541. Unit Testing का मुख्य उद्देश्य क्या है?
[A] Individual Units Test करना
[B] Database Backup
[C] Deploy Application
[D] Manage Sessions
541. What is the main purpose of Unit Testing?
[A] Test Individual Units
[B] Database Backup
[C] Deploy Application
[D] Manage Sessions
सही उत्तर: Individual Units Test करना
व्याख्या: छोटे code units/functions को independently test किया जाता है।
Correct Answer: Test Individual Units
Explanation: Tests small code units independently.
542. PHPUnit में assertions किसलिए उपयोग होते हैं?
[A] Expected Result Verify करने के लिए
[B] Database Connect करने के लिए
[C] Session Start करने के लिए
[D] File Upload करने के लिए
542. What are assertions used for in PHPUnit?
[A] Verify Expected Results
[B] Connect Database
[C] Start Session
[D] Upload Files
सही उत्तर: Expected Result Verify करने के लिए
व्याख्या: Test result को validate करते हैं।
Correct Answer: Verify Expected Results
Explanation: Validates test results.
543. assertEquals() क्या check करता है?
[A] Expected और Actual Value समान हैं
[B] Object Delete करता है
[C] Database Query चलाता है
[D] Session Create करता है
543. What does assertEquals() check?
[A] Expected and Actual values are equal
[B] Deletes object
[C] Runs database query
[D] Creates session
सही उत्तर: Expected और Actual Value समान हैं
व्याख्या: Values equality check करता है।
Correct Answer: Expected and Actual values are equal
Explanation: Checks value equality.
544. SOLID में S किसका प्रतिनिधित्व करता है?
[A] Single Responsibility Principle
[B] Secure Responsibility Principle
[C] System Resource Principle
[D] Static Responsibility Principle
544. What does S stand for in SOLID?
[A] Single Responsibility Principle
[B] Secure Responsibility Principle
[C] System Resource Principle
[D] Static Responsibility Principle
सही उत्तर: Single Responsibility Principle
व्याख्या: एक class का केवल एक responsibility होना चाहिए।
Correct Answer: Single Responsibility Principle
Explanation: A class should have only one responsibility.
545. SOLID में O किसका प्रतिनिधित्व करता है?
[A] Open Closed Principle
[B] Object Creation Principle
[C] Operation Control Principle
[D] Open Code Principle
545. What does O stand for in SOLID?
[A] Open Closed Principle
[B] Object Creation Principle
[C] Operation Control Principle
[D] Open Code Principle
सही उत्तर: Open Closed Principle
व्याख्या: Software entities extension के लिए open, modification के लिए closed हों।
Correct Answer: Open Closed Principle
Explanation: Entities should be open for extension and closed for modification.
546. SOLID में L किसका प्रतिनिधित्व करता है?
[A] Liskov Substitution Principle
[B] Logical System Principle
[C] Layer Security Principle
[D] Library Structure Principle
546. What does L stand for in SOLID?
[A] Liskov Substitution Principle
[B] Logical System Principle
[C] Layer Security Principle
[D] Library Structure Principle
सही उत्तर: Liskov Substitution Principle
व्याख्या: Derived classes base class को replace कर सकें।
Correct Answer: Liskov Substitution Principle
Explanation: Derived classes should replace base classes without issues.
547. SOLID में I किसका प्रतिनिधित्व करता है?
[A] Interface Segregation Principle
[B] Internal Security Principle
[C] Integration Service Principle
[D] Input Structure Principle
547. What does I stand for in SOLID?
[A] Interface Segregation Principle
[B] Internal Security Principle
[C] Integration Service Principle
[D] Input Structure Principle
सही उत्तर: Interface Segregation Principle
व्याख्या: Clients को unnecessary interfaces implement नहीं करने चाहिए।
Correct Answer: Interface Segregation Principle
Explanation: Clients should not depend on unused interfaces.
548. SOLID में D किसका प्रतिनिधित्व करता है?
[A] Dependency Inversion Principle
[B] Data Integrity Principle
[C] Database Injection Principle
[D] Distributed Integration Principle
548. What does D stand for in SOLID?
[A] Dependency Inversion Principle
[B] Data Integrity Principle
[C] Database Injection Principle
[D] Distributed Integration Principle
सही उत्तर: Dependency Inversion Principle
व्याख्या: High-level modules low-level modules पर depend नहीं करें।
Correct Answer: Dependency Inversion Principle
Explanation: High-level modules should not depend on low-level modules.
549. Code Refactoring का उद्देश्य क्या है?
[A] Code Improve करना बिना behavior बदले
[B] Database Optimize करना
[C] Server Upgrade करना
[D] UI Design करना
549. What is the purpose of Refactoring?
[A] Improve code without changing behavior
[B] Optimize database
[C] Upgrade server
[D] Design UI
सही उत्तर: Code Improve करना बिना behavior बदले
व्याख्या: Internal structure improve होती है।
Correct Answer: Improve code without changing behavior
Explanation: Improves internal structure.
550. Clean Code का मुख्य उद्देश्य क्या है?
[A] Readable और Maintainable Code
[B] Complex Code
[C] Large Files
[D] More Queries
550. What is the main goal of Clean Code?
[A] Readable and Maintainable Code
[B] Complex Code
[C] Large Files
[D] More Queries
सही उत्तर: Readable और Maintainable Code
व्याख्या: Code समझने और maintain करने में आसान हो।
Correct Answer: Readable and Maintainable Code
Explanation: Code should be easy to understand and maintain.