This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| class CopyOfExample { | |
| public static void main(String args[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| class GreatHouse { | |
| private String name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| class ImmutableListCopyExample { | |
| public static void main(String args[]) { | |
| List<String> unmutableGreatHouses = List.of("Stark", "Arryn", "Lannister", "Martell", "Targaryen", "Tully", "Greyjoy", "Tyrell", "Baratheon"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.List; | |
| class ImmutableListsExample { | |
| public static void main(String args[]) { | |
| List<String> greatHouses = List.of("Stark", "Arryn", "Lannister", "Martell", "Targaryen", "Tully", "Greyjoy", "Tyrell", "Baratheon"); | |
| System.out.println("Great Houses of Westeros: " + greatHouses); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| class BetterUnmodifiableListsExample { | |
| public static void main(String args[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| class UnmodifiableListsExample { | |
| public static void main(String args[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| noble_gaz = [ | |
| {"name": "HELIUM", "symbol": "He", "atomic number": 2}, | |
| {"name": "NEON", "symbol": "Ne", "atomic number": 10}, | |
| {"name": "ARGON", "symbol": "Ar", "atomic number": 18}, | |
| {"name": "KRYPTON", "symbol": "Kr", "atomic number": 36}, | |
| {"name": "XENON", "symbol": "Xe", "atomic number": 54}, | |
| {"name": "RADON", "symbol": "Rn", "atomic number": 86}, | |
| ] | |
| symbol = input("Entrer le symbole d'un gaz noble: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| noble_gaz = [ | |
| {"name": "HELIUM", "symbol": "He", "atomic number": 2}, | |
| {"name": "NEON", "symbol": "Ne", "atomic number": 10}, | |
| {"name": "ARGON", "symbol": "Ar", "atomic number": 18}, | |
| {"name": "KRYPTON", "symbol": "Kr", "atomic number": 36}, | |
| {"name": "XENON", "symbol": "Xe", "atomic number": 54}, | |
| {"name": "RADON", "symbol": "Rn", "atomic number": 86}, | |
| ] | |
| symbol = input("Entrer le symbole d'un gaz noble: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| noble_gaz = [ | |
| {"name": "HELIUM", "symbol": "He", "atomic number": 2}, | |
| {"name": "NEON", "symbol": "Ne", "atomic number": 10}, | |
| {"name": "ARGON", "symbol": "Ar", "atomic number": 18}, | |
| {"name": "KRYPTON", "symbol": "Kr", "atomic number": 36}, | |
| {"name": "XENON", "symbol": "Xe", "atomic number": 54}, | |
| {"name": "RADON", "symbol": "Rn", "atomic number": 86}, | |
| ] | |
| symbol = input("Entrer le symbole d'un gaz noble: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pokemon = { | |
| name: "Bulbasaur", | |
| type: [ | |
| "Grass", | |
| "Poison" | |
| ], | |
| base: { | |
| hp: 45, | |
| attack: 49, | |
| defense: 49, |
NewerOlder