Skip to main content

OOps fundamentals

Few basics of OOP for C#

1. Overloading: points to be remembered
    A method with same name but differentiated on below:
                -Number of Parameter of method
                -Sequence of parameter of method
                -Type of parameter of method (Ex. int, string....etc)
   But does not matter is:
                -return type is not part of Method Overload

2. Abstract class: points to be remembered:
                -Can not instantiate
                -Should have access specifier (public...private can not be abstract class)
                -Class contains at least one abstract method, class must be declared as an abstract class (by putting abstract keyword before class name)
                -Can have methods with implementation (normal methods)
                -Can have methods without implementation (with abstract keyword Ex. public abstract void Method())
                

Comments

Popular posts from this blog

API Basics

 

Algorithm solving Common Patterns & Techniques

  These are targeted data manipulation strategies used to handle arrays, strings, and linked lists efficiently. Two Pointers : Uses two reference pointers to iterate through a data structure simultaneously, typically from opposite ends or at different speeds (Fast & Slow pointers). Sliding Window : Maintains a subset of data (a "window") over a sequential structure to track running statistics without recalculating the whole set. Prefix Sum : Pre-computes and stores cumulative sums of an array to allow for \(O(1)\) constant-time range sum queries. Dynamic Programming (DP ): Dynamic programming is an optimization technique used to solve problems by breaking them down into simpler subproblems and storing the results of these subproblems to avoid redundant computations. It is particularly effective for problems exhibiting overlapping subproblems and optimal substructure. Greedy Algorithm Breadth-First Search (BFS) / Depth-First Search (DFS) : Systematic graph and tree travers...