“C# syntax feels familiar, behavior is different.”
🧩 Program Structure (Main)
- Java ☕:
public static void main(String[] args) - C# 🔷:
static void Main(string[] args) - C# supports top-level statements ⚡ (less boilerplate)
🔁 Value Types vs Reference Types
Java ☕
- Primitives 🧮:
int,double→ value - Objects 📦: always reference
C# 🔷
- Value types 🧮:
int,struct(stack) - Reference types 📦:
class,array(heap)
🧠 var, const, readonly
Java ☕
var(local only)final🔒 (constant-like)
C# 🔷
var⚡ (type inference)const🔐 (compile-time)readonly🛡️ (runtime, constructor-safe)
🏷️ Properties vs Getters / Setters
Java ☕
- Explicit
getX()/setX()⚙️
C# 🔷
- Properties ✨
- Cleaner, built-in
get; set;
🆚 struct vs class
Java ☕
- No
struct - Everything is a
class
C# 🔷
struct📐: value type, lightweightclass🏗️: reference type, OOP-heavy
