Skip to content

Preface

"Why can't I understand anything in class?" "How do you actually learn programming?" "Why do I grasp everything the teacher explains, yet feel completely lost when writing code myself?" "I can comprehend others' code, but I'd never think to write it that way myself?"

When helping others learn programming, I’m often asked these questions. There are many similar questions, but their root cause is the same: Knowing ≠ Being able to use. Many fall into the same misconception: believing that merely knowing a concept means they’ve mastered it.

Yet, reality disagrees.

Learning programming is like learning to write: acquiring a new concept is like learning a new word. But writing well isn’t about who knows the most words: only elementary students compete that way. Yet, you can’t know too few, or you’ll lack the words to express yourself.

Chinese writer Yu Hua once said: "I don’t know many Chinese characters, but enough, I think, to write fiction."

"Later critics praised my writing for its simplicity— only because my vocabulary was small."

——Yu Hua

The same applies to programming.

Its essence isn’t memorizing syntax, but how to compose "sentences" from "words," weaving them into "essays" that solve real problems. Beginners often swing between extremes: obsessively memorizing syntax without practice, or rushing ahead without mastering basics. Thus, I use writing as a metaphor to teach this lesson: balance "lexical richness" with "narrative skill," depth with breadth.

This is why our tutorial adopts a language-acquisition framework: treating Java as a special language to "talk with" computers. When your audience shifts from humans to machines, "clarity" becomes "rigorous logic," and "eloquence" transforms into "elegant architecture." This is as well the core methodology of Java Programming: From Words to Works—we must not only recognize programming’s "characters," but also craft "essays" that solve problems.

Beyond confusion, many learners feel a sense of meaninglessness—typing mechanically, unsure of their actions, doubting their aptitude. This stems from overemphasizing "how" in teaching while neglecting the "why." But when learning, we should ask: What’s our goal? What can current knowledge achieve? How does new knowledge help? Only then do we grasp its purpose and wield it effectively. As German philosopher Nietzsche noted, one who has a "why" can bear almost any "how."

"He who has a why to live for can bear almost any how."

——Friedrich Nietzsche

This textbook prioritizes the "why before how" principle. For instance, when introducing methods, we’ll first explore solving problems without them, making their necessity tangible. Similarly, arrays will debut through experiencing their absence.

"What I cannot create, I do not understand."

——Richard Feynman

Programming mastery grows not linearly, but through debugging iterations and project-based reinforcement. May this guide deepen your Java understanding and propel you forward on your coding journey.

Wang Kaixin May 21, 2025 at Wenzhou-Kean University, Zhejiang, China