# PHP 객체지향 기초 (Laravel) > 클래스, 객체, 가시성, 상속, 트레이트, 인터페이스, 추상 클래스, 정적 멤버 - 20 면접 질문 - Junior - [면접 질문: Laravel](https://sharpskill.dev/ko/technologies/laravel/interview-questions.md) ## 1. PHP에서 클래스란 무엇입니까? **답변** 클래스는 객체의 프로퍼티와 메서드를 정의하는 청사진(blueprint)입니다. 데이터(프로퍼티)와 동작(메서드)을 재사용 가능한 구조로 캡슐화합니다. 클래스를 사용하면 동일한 구조이지만 값이 다른 여러 인스턴스(객체)를 만들 수 있습니다. ## 2. PHP에서 class의 인스턴스를 어떻게 생성합니까? **답변** 'new' 키워드를 사용하면 class를 인스턴스화하여 object를 생성할 수 있습니다. 예를 들어 'new User()' 는 User 클래스의 새 인스턴스를 생성합니다. class에 constructor가 있는 경우 인수를 직접 전달할 수 있습니다. 'new User("John")' 은 제공된 파라미터로 __construct() 를 자동으로 호출합니다. ## 3. PHP에서 'public' 속성과 'private' 속성의 차이점은 무엇입니까? **답변** 'public' 속성은 class 외부에서(object를 통해 또는 자식 클래스 내에서) 접근할 수 있는 반면, 'private' 속성은 이를 정의한 class 내에서만 접근할 수 있습니다. 'private' 를 사용하면 데이터가 캡슐화되고 직접 접근이 방지되어, 데이터 조작을 제어하기 위해 getter/setter 사용이 강제됩니다. 이는 데이터 무결성을 보호하기 위한 권장 사례입니다. ## 17개 추가 질문 이용 가능 - PHP에서 'protected' 가시성의 역할은 무엇입니까? - PHP에서 constructor를 어떻게 정의합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Laravel 면접 주제 - [PHP 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/php-basics.md): 25개 질문, Junior - [Composer & Autoloading](https://sharpskill.dev/ko/technologies/laravel/interview-questions/composer-autoloading.md): 18개 질문, Junior - [Laravel 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-fundamentals.md): 20개 질문, Junior - [Laravel 라우팅](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-routing.md): 20개 질문, Junior - [Blade Templates](https://sharpskill.dev/ko/technologies/laravel/interview-questions/blade-templates.md): 18개 질문, Junior - [Request & Response](https://sharpskill.dev/ko/technologies/laravel/interview-questions/request-response.md): 20개 질문, Junior - [Eloquent ORM 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-orm-basics.md): 22개 질문, Junior - [Eloquent Relationships](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-relationships.md): 25개 질문, Mid-Level - [Migrations & Schema Builder](https://sharpskill.dev/ko/technologies/laravel/interview-questions/database-migrations.md): 20개 질문, Mid-Level - [유효성 검사와 폼](https://sharpskill.dev/ko/technologies/laravel/interview-questions/validation-forms.md): 22개 질문, Mid-Level - [인증](https://sharpskill.dev/ko/technologies/laravel/interview-questions/authentication.md): 20개 질문, Mid-Level - [인가와 Policies](https://sharpskill.dev/ko/technologies/laravel/interview-questions/authorization-policies.md): 18개 질문, Mid-Level - [API Resources & Authentication](https://sharpskill.dev/ko/technologies/laravel/interview-questions/api-resources-authentication.md): 26개 질문, Mid-Level - [미들웨어](https://sharpskill.dev/ko/technologies/laravel/interview-questions/middleware.md): 18개 질문, Mid-Level - [Service Container & DI](https://sharpskill.dev/ko/technologies/laravel/interview-questions/service-container-di.md): 20개 질문, Mid-Level - [Queues & Jobs](https://sharpskill.dev/ko/technologies/laravel/interview-questions/queues-jobs.md): 22개 질문, Mid-Level - [Events & Listeners](https://sharpskill.dev/ko/technologies/laravel/interview-questions/events-listeners.md): 18개 질문, Mid-Level - [알림 및 메일](https://sharpskill.dev/ko/technologies/laravel/interview-questions/notifications-mail.md): 20개 질문, Mid-Level - [File Storage](https://sharpskill.dev/ko/technologies/laravel/interview-questions/file-storage.md): 18개 질문, Mid-Level - [Testing & PHPUnit](https://sharpskill.dev/ko/technologies/laravel/interview-questions/testing-phpunit.md): 24개 질문, Mid-Level - [Caching](https://sharpskill.dev/ko/technologies/laravel/interview-questions/caching.md): 18개 질문, Mid-Level - [Livewire & Inertia](https://sharpskill.dev/ko/technologies/laravel/interview-questions/livewire-inertia.md): 20개 질문, Mid-Level - [Eloquent Advanced](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-advanced.md): 24개 질문, Senior - [Repository Pattern](https://sharpskill.dev/ko/technologies/laravel/interview-questions/repository-pattern.md): 20개 질문, Senior - [Laravel 패키지](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-packages.md): 20개 질문, Senior - [Performance Optimization](https://sharpskill.dev/ko/technologies/laravel/interview-questions/performance-optimization.md): 22개 질문, Senior - [Security Best Practices](https://sharpskill.dev/ko/technologies/laravel/interview-questions/security-best-practices.md): 22개 질문, Senior - [Laravel Octane](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-octane.md): 18개 질문, Senior - [Laravel Distributed Systems](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-distributed-systems.md): 22개 질문, Senior - [Observability & Monitoring](https://sharpskill.dev/ko/technologies/laravel/interview-questions/observability-monitoring.md): 20개 질문, Senior - [Deployment & DevOps](https://sharpskill.dev/ko/technologies/laravel/interview-questions/deployment-devops.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/laravel/interview-questions/php-oop-essentials