在Java 9中的JShell中我们需要遵循哪些规则?
以下是使用JShell工具时需要遵循的一些规则。
片段
jshell> class Employee {
...> private String firstName;
...> private String lastName;
...> private String designation;
...> public Employee(String firstName, String lastName, String designation) {
...> this.firstName = firstName;
...> this.lastName = lastName;
...> this.designation = designation;
...> }
...> public String getFirstName() {
...> return firstName;
...> }
...> public String getLastName() {
...> return lastName;
...> }
...> public String getDesignation() {
...> return designation;
...> }
...> public String toString() {
...> return "Name = " + firstName + ", " + lastName + " | " +
...> "designation = " + designation;
...> }
...> }
| created class Employee
jshell> Employee emp = new Employee("Sai", "Adithya", "Content Developer");
emp ==> Name = Sai, Adithya | designation = Content Developer热门推荐
10 儿子立冬祝福语简短独特
11 中考家长祝福语简短励志
12 春节红包祝福语大全简短
13 作文老师寄语简短祝福语
14 朋友的孩子祝福语简短
15 精辟简短的公司祝福语
16 新年简短祝福语大全集
17 节日结束祝福语简短的
18 忌日祝福语简短10字