Immutable list from objects - Guava

    0

    0

    Java Public Recipes

    The following code creates an immutable list containing two objects.

    import com.google.common.collect.ImmutableList;
    
    List newList = ImmutableList.of(object1, object2);
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.