Skip to content

Different types Quote by Herbert Schildt

“For example, consider a stack (which is a first-in, last-out list). You might have a program that requires three different types of stacks. One stack is used for integer values, one for floating-point values, and one for characters. In this case, the algorithm that implements each stack is the…” quote by Herbert Schildt
Download Open image
““For example, consider a stack (which is a first-in, last-out list). You might have a program that requires three different types of stacks. One stack is used for integer values, one for floating-point values, and one for characters. In this case, the algorithm that implements each stack is the same, even though the data being stored differs. In a non-object-oriented language, you would be required to create three different sets of stack routines, with each set using different names. However, because of polymorphism, in Java you can create one general set of stack routines that works for all three specific situations. This way, once you know how to use one stack, you can use them all. More generally, the concept of polymorphism is often expressed by the phrase “one interface, multiple methods.” This means that it is possible to design a generic interface to a group of related activities. Polymorphism helps reduce complexity by allowing the same interface to be used to specify a general class of action.””

Herbert Schildt

About This Quote

Source Book: Java: The Complete Reference, 1997

Polymorphism lets one interface serve many data types, simplifying code and reducing duplication.

In simple terms: One interface, many uses.

Key Takeaway

Use polymorphism to write reusable code.

Themes

programming software design abstraction efficiency

Mood

technical educational practical

Type

educational inspirational

When to use this quote

  • building libraries
  • teaching programming
  • refactoring legacy code

Key Concepts

object‑oriented programming type theory software engineering

Questions to Reflect On

  • When is polymorphism unnecessary?
  • How does it affect debugging?
A Different Perspective

Overuse can hide complexity and cause performance issues.

4.7 out of 5 (4 ratings)

More Different types quotes

Browse all 526 Different types quotes