Introduction to Programming Using Java
Not rated yetRate this bookIntroduction to Programming Using Java by David J. Eck develops programming from execution and data to objects, interfaces, collections, files, networking, and concurrency. This guide follows Version 9, the JavaFX edition dated May 2022. The thirteen chapters build a model of program behaviour: which information exists, where it is stored, which operations can change it, and how execution proceeds. Read by writing programs and testing predictions. Examples become useful when you can explain both their successful results and the conditions under which they fail.
Free reading is available at the official source. Opens in a new tab.
FreeAbout this book
Introduction to Programming Using Java by David J. Eck develops programming from execution and data to objects, interfaces, collections, files, networking, and concurrency. This guide follows Version 9, the JavaFX edition dated May 2022. The thirteen chapters build a model of program behaviour: which information exists, where it is stored, which operations can change it, and how execution proceeds. Read by writing programs and testing predictions. Examples become useful when you can explain both their successful results and the conditions under which they fail.
Cover: source-edition cover, displayed to identify the linked book. Publisher and third-party rights remain with their respective holders.
Book summary
About this book
Introduction to Programming Using Java by David J. Eck develops programming from execution and data to objects, interfaces, collections, files, networking, and concurrency. This guide follows Version 9, the JavaFX edition dated May 2022. The thirteen chapters build a model of program behaviour: which information exists, where it is stored, which operations can change it, and how execution proceeds. Read by writing programs and testing predictions. Examples become useful when you can explain both their successful results and the conditions under which they fail.
Chapter-by-chapter summaries
1. The mental landscape
Machine instructions, asynchronous events, the Java Virtual Machine, object-oriented organization, interfaces, and networks establish the execution environment. Compilation differs from running, and event-driven applications do not follow one uninterrupted top-to-bottom sequence. Sketch the path from source code to execution and explain the JVM’s role. Distinguish syntax errors, runtime failures, and incorrect results. This mental model makes later language features parts of a coherent computational process rather than isolated syntax rules.
2. Names and things
Variables, types, literals, expressions, strings, objects, subroutines, and input/output establish data representation. Types constrain values and operations, while references differ from primitive values. Integer division requires different expectations from floating-point arithmetic. Trace variable values after each statement and check grouping and conversions. A useful exercise is to predict the result before execution, then explain every discrepancy. Producing the expected output is insufficient if the steps generating it remain unclear.
3. Control
Branches and loops determine which statements execute and how often. Initialization, continuation tests, and updates must cooperate to produce progress. For each loop, explain what one iteration accomplishes and why execution eventually stops. Test zero, one, and many iterations. Nested structures increase tracing demands without changing the basic principles. Off-by-one errors often reveal an unclear definition of the intended range; state that range explicitly before adjusting comparison operators experimentally.
4. Subroutines
Subroutines package computations through names, parameters, and optional return values. Arguments supply values to parameters, and local variables belong to a particular invocation. Decomposition helps when every method has a clear responsibility and contract. Specify inputs, outputs, and assumptions before implementing it. Test the method separately from its application. Returning a value permits further computation, while printing commits to presentation. Make dependencies visible through parameters rather than relying unnecessarily on unrelated shared state.
5. Objects and classes
Classes describe state and behaviour; constructors establish initial state. Encapsulation allows operations to preserve constraints on representation. Inheritance and polymorphism organize related behaviour when the subtype relationship is appropriate. Draw two instances with different fields and trace the same method call on each. Distinguish static members from instance members and object identity from equal content. A useful model assigns responsibilities and interactions, not merely class names copied from nouns in the problem description.
6. Introduction to GUI programming
JavaFX organizes visual components, scenes, layout, drawing, and event handling. State changes happen in response to actions rather than only through a console script. Separate the application model from the controls displaying it. Build one clear state transition and predict how the event updates both data and display. Respect the toolkit’s threading rules. The source is the JavaFX edition; examples from Swing-based textbook versions require different setup and should not be mixed without explanation.
7. Arrays, ArrayLists, and records
Data collections require choices about size, indexing, traversal, and representation. Arrays have fixed length, while ArrayLists support resizing through their API. Records group component data concisely in the source version. Compare accessing, inserting, removing, and searching. Test empty collections and check valid indices before traversal. When related information belongs together, use a representation preserving that relationship rather than parallel lists whose corresponding positions can become inconsistent after updates.
8. Correctness, robustness, efficiency
Compilation does not establish correctness or resilience. Preconditions and postconditions clarify intended behaviour; validation and exception handling address invalid input and failures. Efficiency concerns growth in resource use rather than a small demonstration’s apparent speed. Test boundaries and violated assumptions, separating algorithmic bugs from environmental problems. Reason about correctness alongside empirical tests: tests examine selected cases, while a specification describes required behaviour across the permitted inputs. Measure performance only after defining what work is being compared.
9. Linked structures and recursion
Recursion needs a base case and demonstrable progress toward it. Linked lists and trees represent relationships through references, making recursive structure natural. Draw nodes and links before changing them, since an update can lose access to data if performed in the wrong order. Trace recursive calls in separate frames and then unwind the returns. Distinguish recursion depth from total work. A compact method may perform many calls, so code length is not an adequate measure of computational cost.
10. Generic programming and collections
Generics enable reusable algorithms and containers with useful compile-time type checks. Lists, sets, maps, and ordered structures provide different abstractions. Choose according to required operations and guarantees. Compare preserving duplicates with modeling unique membership and associating keys with values. Equality and ordering definitions affect results, especially in collection operations. Depend on an appropriate abstraction when the implementation is not essential to the application’s contract, and justify the structure rather than selecting the first familiar class.
11. I/O streams, files, and networking
Byte and character streams move data between programs and external resources. Files and connections introduce partial data, encodings, resource lifetimes, and failures outside direct program control. Specify the format and how its end is recognized. A successful read of one value does not imply that all intended data arrived. Manage resources and separate malformed content from an unavailable source. Verify save-and-load behaviour using boundary cases and meaningful text rather than only a trivial example.
12. Threads and multiprocessing
Concurrency introduces interleaved or parallel execution and the need to coordinate shared mutable state. Different schedules can produce different results even when individual operations appear correct. Trace two interleavings of a shared update to expose a race. Design ownership and communication before adding locks reactively. Responsiveness differs from speed: a background task can improve interaction without reducing total computation. Evaluate synchronization against the state and invariants it protects, not simply whether one test run happens to succeed.
13. GUI programming continued
Richer JavaFX applications increase the importance of layout, coherent state, and clear event responsibilities. Specify visible states and the events that allow transitions. Keep expensive work from blocking interaction while updating the display in the correct environment. Test sequences of actions, including cancellation and repeated operations, rather than isolated clicks. The chapter integrates objects, collections, files, and concurrency in applications whose correctness includes both their internal model and the behaviour visible to users.
Study instructions
- Prepare a compatible JavaFX environment and record changes needed for your Java version.
- Predict output and state changes before running examples; vary one assumption at a time.
- Build a chapter project from a written contract and test empty, boundary, normal, and invalid cases.
- Use diagrams for references, recursion, and shared-state access to explain bugs before editing.
Questions for reflection
- When does passing a reference allow a method to alter shared state?
- Why can individually correct operations form an unsafe concurrent update?
- How should tests change for an event-driven application?
Sources and coverage
This original reading guide covers the linked edition’s main chapters, or the principal sections of its two-chapter calculus text. Consult the source for full arguments, cases, worked examples, exercises, illustrations, and references. Version 9, JavaFX edition, May 2022; later revisions may use different APIs or examples. Read the source edition.
This page provides book information and study material. Full-text access is provided by the original publisher or authorised source; a listing does not grant permission to republish the book.
Read our Library Access & Copyright policyExplore the contents
Check the chapters covered in this edition.
Visit the official source
See reading, preview or purchase options.
Save for later
Keep this textbook in your saved collection.
Reader ratings & reviews
Share your thoughts
Your review helps other students choose the right resources.







