B Tutorials tal-Kodifikazzjoni tal-Kompjuter Volum 1

Polimorfiżmu

⚔️ Polimorfiżmu

XP: 0/100

Livell: Kodifikatur tal-Bidu

Bidu 🎮 tal-Missjoni

Inti se tieħu ħsieb:

  • Polimorfiżmu (Qawwa OOP)
  • Algoritmi (Loġika għas-Soluzzjoni tal-Problemi)

🧠 Polimorfiżmu Mistoqsija 1

X' inhu l-polimorfiżmu?

Many forms of a method or object
Only one function exists
A type of loop

💻 Code Understanding

What will this output?

class Animal { void sound() { System.out.println(“Animal sound”); } } class Dog extends Animal { void sound() { System.out.println(“Bark”); } }

Which method runs?

Animal sound
Bark
Error

⚙️ Algorithms Question 1

Which algorithm is fastest for large sorted lists?

Linear Search
Binary Search
Bubble Sort

🧩 Logic Challenge

What is the time complexity of this loop?

for (i = 0; i
O(1)
O(n)
O(n²)

🏆 Final Boss

Which concept allows method overriding?

Polymorphism
Encapsulation
Compilation

🏆 Congratulations!

Enter your name: