Apa Output Codingan dibawah ini .....
class Animal {
public function sound() {
return "Animal Sound";
}
}
class Dog extends Animal {
public function sound() {
return "Bark";
}
}
$dog = new Dog();
echo $dog->sound();
Pengayaan : Soal Matpel PBTGM Kelas 12 RPL 2
Quiz
•
Engineering
•
12th Grade
•
Easy
FIKRI BAHTIAR
Used 6+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa Output Codingan dibawah ini .....
class Animal {
public function sound() {
return "Animal Sound";
}
}
class Dog extends Animal {
public function sound() {
return "Bark";
}
}
$dog = new Dog();
echo $dog->sound();
Animal Sound
Bark
Error
Dog Sound
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa output dari kode berikut?
class Car {
public $color = "Red";
public function getColor() {
return $this->color;
}
}
$myCar = new Car();
$myCar->color = "Blue";
echo $myCar->getColor();
Red
Blue
Error
NULL
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang dimaksud dengan public dalam deklarasi metode atau properti dalam PHP OOP?
Akses hanya bisa dilakukan dari dalam kelas yang sama
Akses bisa dilakukan dari kelas mana pun
Akses hanya bisa dilakukan dari objek
Akses hanya bisa dilakukan dari kelas turunan
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Mana yang benar tentang penggunaan construct() dalam PHP?
Itu adalah metode yang dipanggil secara otomatis saat objek dibuat
Itu adalah metode yang dipanggil saat objek dihapus
Itu adalah metode yang tidak bisa menerima parameter
Itu adalah metode yang hanya dipanggil oleh kelas turunan
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang dimaksud dengan inheritance dalam PHP OOP?
Mengubah properti objek setelah objek dibuat
Menurunkan properti dan metode dari kelas induk ke kelas turunan
Memanggil metode statis dari kelas lain
Menggunakan fungsi di luar kelas
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang ditunjukkan oleh kode berikut?
class Car {
private $engine;
public function __construct($engine) {
$this->engine = $engine;
}
public function getEngine() {
return $this->engine;
}
}
$myCar = new Car("V8");
echo $myCar->getEngine();
NULL
V8
ERROR
Engine
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang terjadi jika Anda mencoba mengakses properti private dari luar kelas?
Nilai properti tidak bisa diubah
Akan muncul error
Nilai properti dapat diubah
Properti menjadi public
10 questions
Recap of Sessions 10 & 11
Quiz
•
11th Grade - University
20 questions
Quiz Pemrograman Arduino
Quiz
•
11th Grade - University
20 questions
Engineering History TEST
Quiz
•
9th - 12th Grade
10 questions
Car Noise Limits and Regulations Quiz
Quiz
•
12th Grade - University
16 questions
Automotive Workshop G3 Quiz
Quiz
•
1st Grade - University
15 questions
2.3.4 - NSPE Code of Ethics
Quiz
•
10th Grade - University
10 questions
PBO PTS GASAL
Quiz
•
12th Grade
12 questions
kuis Pemrograman & Aplikasi Mikrokontroller
Quiz
•
9th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz
Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
15 questions
June Review Quiz
Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles
Quiz
•
8th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
65 questions
MegaQuiz v2 2025
Quiz
•
9th - 12th Grade
10 questions
GPA Lesson
Lesson
•
9th - 12th Grade
15 questions
SMART Goals
Quiz
•
8th - 12th Grade
45 questions
Week 3.5 Review: Set 1
Quiz
•
9th - 12th Grade