Programming in Java

Unit 3: Operators

From arithmetic to bitwise — master every Java operator, understand precedence traps, and build real-world calculators used by fintech companies.

⏱️ Time to Complete: 4 hrs theory + 3 hrs lab  |  💰 Earning Potential: ₹5K–₹15K/month  |  📝 30 MCQs (Bloom's Mapped)

💼 Jobs this unlocks: Java Developer (₹4–8 LPA)  |  Fintech Engineer (₹6–12 LPA)  |  Android Developer (₹5–10 LPA)

Section A

Opening Hook — Operators Power India's Biggest Trading Platform

🏢 How Zerodha's P&L Calculator Uses Every Operator You'll Learn Today

Open the Zerodha Kite app and check your Profit & Loss (P&L) statement. Behind that simple green/red number is a symphony of Java operators working in real-time. Arithmetic operators calculate (sellPrice - buyPrice) * quantity. Relational operators check if (profit > 0) to show green vs red. Logical operators determine if (isIntraday && isPositionOpen) for margin calculations. Bitwise operators encode trade flags for high-speed order matching. Ternary operators decide status = (pnl >= 0) ? "PROFIT" : "LOSS".

Zerodha processes over 15 million orders per day — each one evaluated through dozens of operator-based calculations in microseconds. Their matching engine, built in Java, uses operator precedence rules exactly like you'll learn in this chapter. One wrong bracket, one confused ++i vs i++, and millions of rupees could go wrong.

What if YOU built this? What if you understood operators so well that you could build a P&L calculator, a tax engine, or a trading bot? That's exactly what this unit teaches you — operator by operator, trap by trap.

🇮🇳 Zerodha🇮🇳 Groww🇮🇳 Razorpay🇮🇳 PhonePe🇮🇳 Paytm Money🇮🇳 CRED
Zerodha, founded by Nithin Kamath in 2010, is India's largest stockbroker with 15+ million clients. Their entire trading engine is built in Java. Every single trade passes through operator-based validation logic — the same operators you're about to learn. Mastering operators isn't just academic — it's the foundation of fintech worth ₹2 lakh crore.
Section B

Learning Outcomes — Bloom's Taxonomy Mapped (12 Outcomes)

Bloom's LevelLearning Outcome
🔵 RememberLO-1: List all categories of Java operators — arithmetic, relational, logical, bitwise, assignment, unary, and ternary
🔵 RememberLO-2: State the complete operator precedence table from highest to lowest priority
🟢 UnderstandLO-3: Explain the difference between pre-increment (++i) and post-increment (i++) with memory-level reasoning
🟢 UnderstandLO-4: Describe how short-circuit evaluation works in && and || and why it matters for null-safe code
🟡 ApplyLO-5: Write Java programs using all operator types to solve real calculation problems
🟡 ApplyLO-6: Use the ternary operator and instanceof to write concise conditional logic
🟠 AnalyzeLO-7: Trace complex expressions involving mixed operators and predict exact output (interview-level)
🟠 AnalyzeLO-8: Analyze bitwise operations to understand how flags, masks, and permissions work in system code
🔴 EvaluateLO-9: Evaluate when to use bitwise vs logical operators and justify trade-offs in performance-critical code
🔴 EvaluateLO-10: Judge common operator-related bugs (= vs ==, precedence errors) and propose fixes
🟣 CreateLO-11: Build a complete Zerodha-style P&L calculator using all operator types
🟣 CreateLO-12: Design a permission system using bitwise operators, similar to Unix file permissions