Skip to content

Try “polymorphism”, “TCP handshake” or “git rebase”.

    Classes, Objects and Memory

    Make your own types — constructors, static, references on the stack and objects on the heap, strings and wrappers.

    • Module 2 of 11
    • Beginner
    • 10 chapters
    • 53 min

    Classes are how Java code is organised, and knowing where objects live explains bugs that otherwise look like magic: shared references, null pointers and strings that never change.

    What you will be able to do

    • Design classes with constructors and static members
    • Draw what sits on the stack and the heap
    • Explain why strings are immutable and when to use StringBuilder
    • Compare objects correctly with equals

    Chapters

    Extras