๐ Top Coding Interview Concepts โ Part 4 ๐ป๐ฅ
31. Polymorphism
The ability of the same method or interface to behave differently depending on the object using it.
Example: Different classes can implement the same draw() method in different ways.
32. Abstraction
Hiding unnecessary implementation details and exposing only the essential functionality.
Example: You use a print() function without needing to know how the printer works internally.
33. Constructor
A special method that is automatically called when an object is created and is typically used to initialize its properties.
Example: A Car constructor can set the car's model and color when the object is created.
34. Interface
A contract that defines methods or behaviors a class must provide, without necessarily defining how they are implemented.
Example: A Payment interface may require pay() to be implemented by different payment methods.
35. Method Overloading
Defining multiple methods with the same name but different parameters.
Example: An add() method can accept two numbers or three numbers, depending on the language's support for overloading.
36. Method Overriding
When a child class provides its own implementation of a method already defined in its parent class.
Example: Dog can override an Animal class's sound() method.
37. Pointer
A variable that stores the memory address of another variable or object.
Example: Pointers are commonly used in C and C++ for direct memory manipulation.
38. Reference
A way to refer to an existing object or value without necessarily creating a separate copy of it.
Example: Multiple variables can reference the same object in memory.
39. Memory Management
The process of allocating, using, and releasing memory efficiently during program execution.
Example: Garbage collection automatically removes objects that are no longer needed in languages such as Java and Python.
40. Garbage Collection
An automatic memory-management process that identifies and frees memory occupied by objects that are no longer reachable or needed.
๐ฌ Double Tap โค๏ธ for Part 5!
Post #3138
1.27K
- โค 1