YouTube Channel – Tech Codism with Farhana
C, C++, Java, C# in short
Table
Chapter Page No
1. Core OOP Concept Support Table
Concept C++ Java C#
Class ✅ Yes ✅ Yes ✅ Yes
Object ✅ Yes ✅ Yes ✅ Yes
Inheritance ✅ Yes (single only) ✅ Yes (single only) ✅ Yes (single only)
Multiple Inheritance ✅ Yes (via classes) ❌ (via interfaces only) ❌ (via interfaces only)
Polymorphism ✅ Yes ✅ Yes ✅ Yes
Encapsulation ✅ Yes ✅ Yes ✅ Yes
Abstraction ✅ Yes ✅ Yes ✅ Yes
Interface ✅ via abstract classes ✅ native ✅ native
public, private, protected, public, private, protected,
Access Modifiers public, private, protected
default internal
✅ Yes (no destructor, use
Constructor/Destructor ✅ Yes ✅ Yes (~ClassName())
finalize())
Virtual Methods ✅ virtual / override ✅ @Override ✅ virtual / override
2. Syntax & Keyword Differences (Table)
Feature C++ Java C#
ClassName obj; or new ClassName obj = new ClassName obj = new
Create object
ClassName() ClassName(); ClassName();
Access data members [Link] [Link] [Link]
Always needed for object Always needed for object
Use of new For dynamic allocation (new)
creation creation
Inheritance class B : public A {} class B extends A {} class B : A {}
Virtual methods virtual, override @Override virtual, override
Abstract class class A { virtual void f()=0; } abstract class A {} abstract class A {}
Interface No direct support, use abstract interface I {} interface I {}
Destructor ~ClassName() No destructor, uses finalize() ~ClassName()
public, private, protected,
Access modifier public, private public, private, protected
internal
3. Sample OOP Code (C++ vs Java vs C#)
4. Keyword Comparison Summary Table
Keyword C++ Java C#
new Allocate objects dynamically Create all objects Create all objects
this Refers to current object Same Same
super / base BaseClass::func() super keyword base keyword
virtual Marks overridable method Not used Used
override Marks method override @Override annotation override keyword
abstract Pure virtual class method abstract keyword abstract keyword
interface No native keyword Native interface Native interface
Prevent override (via sealed (class), readonly
final Prevent inheritance
methods) (field)
5. Summary Table of OOP Differences
Feature C++ Java C#
Memory Management Manual (new / delete) GC (Garbage Collector) GC
Multiple Inheritance Yes No (only interfaces) No (only interfaces)
Interface Support Abstract classes only Native interface keyword Native interface keyword
GC-based
Destructor Manual (~ClassName()) GC-based (finalize())
(~ClassName())
Platform Cross-platform (compiled) JVM .NET CLR
Object Allocation Optional (new or stack) Always via new Always via new
Access Modifiers Limited Rich Rich
6. Encapsulation.
7. Abstraction:
8. Polymorphism
9. Inheritance Comparison Table:
Feature C++ Java C#
Basic Syntax class B : public A class B extends A class B : A
Single Inheritance ✅ Supported ✅ Supported ✅ Supported
❌ Not supported (only ❌ Not supported (only
Multiple Inheritance ✅ Supported via classes
interfaces) interfaces)
Multiple via Interface ✅ (via abstract base class) ✅ Supported ✅ Supported
public, protected, public, protected, public, protected,
Access Modifiers
private default internal
super() to call base base() to call base
Constructor chaining Base() called explicitly
constructor constructor
Optional Uses @Override Requires
Override Method Keyword
virtual/override annotation virtual/override
Use final with care (not
Final/Sealed Class final keyword sealed keyword
keyword)
10. Inheritance:
11. F What is LINQ in C#?
LINQ stands for Language-Integrated Query. It's a powerful feature in C# that allows you to query
collections (like arrays, lists, or databases) using a SQL-like syntax directly in your code.
🔗 LINQ Data Sources
LINQ can be used with:
IEnumerable (Lists, Arrays)
IQueryable (Databases via Entity Framework)
XML documents (XDocument)
DataSets
File system (via [Link])
Custom collections