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
| #!/bin/bash | |
| NAME=$1 | |
| LASTNAME=$2 | |
| SHOW=$3 | |
| if [ "$SHOW" = "true" ]; then | |
| echo "Hello, $NAME $LASTNAME" | |
| else | |
| echo "If you want to see the name, please mark the SHOW option" |
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
| #!/bin/bash | |
| NAME=$1 | |
| LASTNAME=$2 | |
| echo "Hello, $NAME $LASTNAME" |
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
| version: '3' | |
| services: | |
| jenkins: | |
| container_name: jenkins | |
| image: jenkins/jenkins | |
| ports: | |
| - "8080:8080" | |
| volumes: | |
| - $PWD/jenkins_home:/var/jenkins_home | |
| networks: |
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
| //在class或fun外面宣告別名 | |
| typealias EmployeeSet = Set<Employee> | |
| fun main() { | |
| val employeeOne = Employee("PIG",1) | |
| val employeeTwo = Employee("HOG",2) | |
| val employeeThree = Employee("HOG",2) |
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
| //在class或fun外面宣告別名 | |
| typealias EmployeeSet = Set<Employee> | |
| fun main() { | |
| val employeeOne = Employee("PIG",1) | |
| val employeeTwo = Employee("HOG",2) | |
| val employeeThree = Employee("HOG",2) |
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
| package com; | |
| public class test { | |
| public static void main(String[] args) { | |
| Employee employee1 = new Employee("PIG",1); | |
| Employee employee2 = new Employee("HOG",2); | |
| Employee employee3 = new Employee("HOG",2); | |
| System.out.println(employee1 == employee2); //false 因為值跟instance都不同 |
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
| package com; | |
| public class Employee { | |
| private String name; | |
| private int id; | |
| public Employee(String name, int id) { | |
| super(); | |
| this.name = name; | |
| this.id = id; |
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
| //在class或fun外面宣告別名 | |
| typealias EmployeeSet = Set<Employee> | |
| fun main() { | |
| //透過別名快速建立實體 | |
| val employees :EmployeeSet | |
| //自製類別實體的val宣告 講解 | |
| val employee = Employee("PIG",500) |
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
| fun main() { | |
| //自製類別實體的val宣告 講解 | |
| val employee = Employee("PIG",500) | |
| // employee=Employee("HOG",500) //error val無法修改實體 | |
| employee.name="HOG" //val 對實體內的屬性作修改是合法的 | |
| val num1 =100 | |
| val num2 =200 |
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
| fun main() { | |
| val employee = Employee("PIG",500) | |
| // employee=Employee("HOG",500) //error | |
| employee.name="HOG" | |
| } | |
| class Employee (var name:String,var id : Int){} |