{
  "id": 8355059,
  "title": "Type Safety Without Explicit Casting: Building a Custom Generic Stack in Java",
  "url": "https://urgent.news/2026/09/19/type-safety-without-explicit-casting-building-a-custom-generic-stack",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-19T01:01:59.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/dhruv101_56/type-safety-without-explicit-casting-building-a-custom-generic-stack-in-java-3c2d"
  },
  "original_language": "en",
  "account": null,
  "summary": "Before Java 5 introduced generics, collections and data structures relied on raw Object references. While this allowed containers to hold any reference type, it deferred type checks to runtime, creating recurring risks of ClassCastException bugs. The Pitfall of Storing Raw Objects Consider a traditional stack built on Object[] : ObjectStack stack = new ObjectStack (); stack . push ( \"Active…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}