Skip to content

Inner Classes - Challenge 1 #244

@BryanF1nes

Description

@BryanF1nes

The following code block while not crazy concerning at the moment, but maybe a comment as I have added to let the individual know that this is ternary operation.

String status() {
            // This code may be "confusing" this is a ternary operator
            // Basically another way to write an 'if / else' statement
            "Controller[" 
                + isPoweredOn ? "ON" : "OFF" + "] - GameConsole["
                + isPoweredOn ? "ON" : "OFF" + "]";
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions