
Object Oriented Programming Quiz
Quiz
•
Information Technology (IT)
•
4th Grade
•
Practice Problem
•
Medium
Cecilio Salonoy
Used 2+ times
FREE Resource
Student preview

40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is encapsulation in object-oriented programming?
Writing code in a procedural style
Allowing free access to all class properties
Restricting direct access to some of an object's components
Making code longer and more complex
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which access modifier is commonly used to implement encapsulation?
public
protected
global
private
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In PHP, which keyword restricts property access to within the class only?
public
private
external
abstract
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of getter methods in encapsulation?
To delete object properties
To provide controlled read access to private properties
To directly change class variables
To generate random values
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the role of a setter method in a class?
Sets cookies
Assigns permissions to users
Assigns a value to a private property using a public method
Reads data from the database
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a benefit of encapsulation?
Slower performance
No need for class constructors
Better control over data and security
Increased global variables
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following class, which method is used to access the $name property?
$person->name;
$person->setName();
$person->getName();
$person->__get();
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Adding and Subtracting Fractions with Like Denominators
Quiz
•
4th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
5 questions
Drama
Quiz
•
3rd - 4th Grade
15 questions
Fractions on a Number Line
Quiz
•
4th Grade
10 questions
Martin Luther King, Jr. For Kids
Interactive video
•
1st - 12th Grade
20 questions
Equivalent Fractions
Quiz
•
4th Grade