Coding Chica

Coding Chica

    • About
    • Available Downloads
    • Jargon Buster
      • A
      • B
      • C
      • D
      • E
      • F
      • G
      • I
      • J
      • L
      • M
      • N
      • O
      • P
      • Q
      • R
      • S
      • T
      • X
    • Topics
      • Getting Started
      • Git 101
      • Java 101
      • Maven Builds
      • Test Driven Development (TDD)
    • Site Map
  • Avoid the Mess! Java Packages

    Java packages can help us quickly find the code we need and avoid naming collisions with similar classes. Read more…

    2023-09-11
  • A Little Bit of This! Java’s Reference to Self

    The keyword “this” in Java is a reference to the current object. In most cases, “this” is optional, however using “this” can be helpful in Java constructors and when dealing with variable shadowing. Read more…

    2023-09-07
  • Me and My Shadow! Variable Shadowing in Java

    Java variable shadowing can cause difficult to see bugs, as the reader thinks one variable is used, while another is actually consumed. Read more…

    2023-09-04
  • Try and Close Me! Java’s Try With Resources

    Even in a simple example, we can save a significant amount of boilerplate code by using Java’s try-with-resources syntax, rather than finally blocks to close our own resources. Read more…

    2023-08-31
  • Verb’s the Word! Java method names

    In Java, methods are typically actions we want taken, so method names are typically either verbs or verb phrases. Unit test method names can carry a slightly different format than runtime method names. Read more…

    2023-08-28
  • Adjectives, Describing State! Boolean Java Variable Names

    For boolean variable names, which may store state, we need a little flexibility from the general noun or noun phrase rule in the prior post. Read more…

    2023-08-24
  • Nouns Abound! Java Parameter And Variable Names

    Good Java input parameter and variable names can help us understand the code more quickly. A few coding conventions also help us understand how a field is used (whether a constant or a variable) by the name’s formatting. Read more…

    2023-08-21
  • Internal Changes Only! Java’s final Keyword for Fields

    Class (static) or instance variables can also be protected from accidental reassignment by using the Java final keyword. Read more…

    2023-08-17
  • Pass by Reference! Java Objects

    Java passes objects to methods by creating a copy of the reference (address for the object in memory). This impacts whether modifications to the input parameter variable and internal state changes are visible to the calling code. Read more…

    2023-08-14
  • Pass by Value! Java Primitives

    When passing a primitive input parameter to a Java method, such as a long, int, boolean, etc., the method receives an independent copy of that value. This is called pass by value and means that the calling code need not worry about the method changing its own variable’s value. Read more…

    2023-08-11
  • Lombok NonNull

    Java null checks can get very long. They can clutter the rest of the code, making it more difficult to see important logic. Lombok @NonNull annotation will help us hide some of that boilerplate, but we should still have automated unit tests for that generated logic. Read more…

    2023-08-09
  • It’s Pointers, Dear Watson! Java’s null

    Pointers are how Java finds Objects in memory. It allows our objects to grow or shrink as needed, without slowing down the application. However, this does mean that our Java applications need to check to see if there is an address to an object or not (AKA a null value). Read more…

    2023-08-07
  • Automate the Formatting! Spotless Maven Plugin

    By automatically applying a consistent style with every build, we can save our team pain both when applying the formatting and when reviewing subsequent PRs. We also briefly introduce the git stash command. Read more…

    2023-08-04
  • You Shall Not Modify! Final Methods and Classes

    In Java, the parent class can decide whether child classes are allowed, or if a child class is allowed to provide its own implementation of a given method. Read more…

    2023-08-03
  • Not For Me, Thanks! Overriding in Java

    In Java, if a child class inherits the parent’s logic, but doesn’t want to use that logic, they can override the method in their own class and modify that behavior. Let’s look at how that would be done in a test-driven-development approach. Read more…

    2023-08-02
  • What’s Yours is Mine! Inheritance in Java

    In Java, we can inherit method bodies from a parent class without any additional work besides declaring our class as extending that parent, whether that parent declared those methods directly, or if they were from an interface that the parent implemented. Let’s look at a partial UML class diagram for java.util.ArrayList to get a better… Read more…

    2023-08-01
  • A New Instance Every Test! JUnit Classes And Fields

    JUnit will create a new instance of the test class for each and every test, so we can store test details in the test’s instance variables, rather than repeating that setup for each test method. Read more…

    2023-07-31
  • On the Way Out! Deprecation

    When directions change, we need a way to convey to calling code that we intend to remove logic in a future version of the code. That way, they have a chance to migrate to the desired approach before their code suddenly breaks. Read more…

    2023-07-28
  • Calculating Age! Using our new Enum in a Switch Expression

    When using an enum in a switch expression, we must supply logic for all possible values (an exhaustive listing). Lets use our new AgeUnits enum in a switch expression to determine the age. Read more…

    2023-07-27
  • What Are My Options? A Simple Java Enum

    A Java enum (enumeration) works well for not-frequently-changing values that can all be listed out. In the simplest form, it is just a lit of values. Read more…

    2023-07-26
Previous Page
1 2 3 4
Next Page

YOU CAN DO THIS. Have faith in yourself. You don’t need to be perfect and you don’t need to get it all right on the first try. Make mistakes. Learn from them. Move forward. Grow.

© Coding Chica 2023

  • Subscribe Subscribed
    • Coding Chica
    • Already have a WordPress.com account? Log in now.
    • Coding Chica
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar