201871020225-牟星源《面向对象程序设计(java)》第七周学习总结

博文正文开头:

项目

内容

这个作业属于哪个课程

https://www.cnblogs.com/nwnu-daizh/

这个作业的要求在哪里

https://www.cnblogs.com/nwnu-daizh/p/11435127.html

作业学习目标

  1. 掌握四种访问权限修饰符的使用特点;
  2. 掌握Object类的用途及常用API;
  3. 掌握ArrayList类的定义方法及用途;
  4. 掌握枚举类定义方法及用途;
  5. 结合本章实验内容,理解继承与多态性两个面向对象程序设计特征,并体会其优点。

随笔博文正文内容:

实验内容和步骤

实验1:在“System.out.println(...);”语句处按注释要求设计代码替换...,观察代码录入中IDE提示,以验证四种权限修饰符的用法。

(1)程序代码

实验代码:

class Parent {

private String p1 = "这是Parent的私有属性";

public String p2 = "这是Parent的公有属性";

protected String p3 = "这是Parent受保护的属性";

String p4 = "这是Parent的默认属性";

private void pMethod1() {

System.out.println("我是Parent用private修饰符修饰的方法");

}

public void pMethod2() {

System.out.println("我是Parent用public修饰符修饰的方法");

}

protected void pMethod3() {

System.out.println("我是Parent用protected修饰符修饰的方法");

}

void pMethod4() {

System.out.println("我是Parent无修饰符修饰的方法");

}

}

class Son extends Parent{

private String s1 = "这是Son的私有属性";

public String s2 = "这是Son的公有属性";

protected String s3 = "这是Son受保护的属性";

String s4 = "这是Son的默认属性";

public void sMethod1() {

System.out.println(p2);//分别尝试显示Parent类的p1、p2、p3、p4值

System.out.println("我是Son用public修饰符修饰的方法");

}

private void sMethod2() {

System.out.println("我是Son用private修饰符修饰的方法");

}

protected void sMethod3() {

System.out.println("我是Son用protected修饰符修饰的方法");

}

void sMethod4() {

System.out.println("我是Son无修饰符修饰的方法");

}

}

public class Demo {

public static void main(String[] args) {

Parent parent=new Parent();

Son son=new Son();

parent.pMethod2() ;  //分别尝试用parent调用Paren类的方法、用son调用Son类的方法

}

}

parent代码:

package mxy;

public class Parent {

private String p1 = "这是Parent的私有属性";

public String p2 = "这是Parent的公有属性";

protected String p3 = "这是Parent受保护的属性";

String p4 = "这是Parent的默认属性";

private void pMethod1() {

System.out.println("我是Parent用private修饰符修饰的方法");

}

public void pMethod2() {

System.out.println("我是Parent用public修饰符修饰的方法");

}

protected void pMethod3() {

System.out.println("我是Parent用protected修饰符修饰的方法");

}

void pMethod4() {

System.out.println("我是Parent无修饰符修饰的方法");

}

}

son代码:

package first;

import mxy.Parent;

public class Son extends Parent{

private String s1 = "这是Son的私有属性";

public String s2 = "这是Son的公有属性";

protected String s3 = "这是Son受保护的属性";

String s4 = "这是Son的默认属性";

public void sMethod1() {

System.out.println(p2);//分别尝试显示Parent类的p1、p2、p3、p4值

System.out.println("我是Son用public修饰符修饰的方法");

}

private void sMethod2() {

System.out.println("我是Son用private修饰符修饰的方法");

}

protected void sMethod3() {

System.out.println("我是Son用protected修饰符修饰的方法");

}

void sMethod4() {

System.out.println("我是Son无修饰符修饰的方法");

}

}

(2)运行结果如下:

Parent1:

Parent2:

Parent3:

Parent4:

Son1:

Son2:

Son3:

Son4:

实验2:导入第5章以下示例程序,测试并进行代码注释。

实验2:测试程序1

l  运行教材程序5-8、5-9、5-10,结合程序运行结果理解程序(教材174页-177页);

5.8代码:

package equals;

/**

* This program demonstrates the equals method.

* @version 1.12 2012-01-26

* @author Cay Horstmann

*/

public class EqualsTest

{

public static void main(String[] args)

{

Employee alice1 = new Employee("Alice Adams", 75000, 1987, 12, 15);

Employee alice2 = alice1;

Employee alice3 = new Employee("Alice Adams", 75000, 1987, 12, 15);

Employee bob = new Employee("Bob Brandson", 50000, 1989, 10, 1);

System.out.println("alice1 == alice2: " + (alice1 == alice2));

System.out.println("alice1 == alice3: " + (alice1 == alice3));

System.out.println("alice1.equals(alice3): " + alice1.equals(alice3));

System.out.println("alice1.equals(bob): " + alice1.equals(bob));

System.out.println("bob.toString(): " + bob);

Manager carl = new Manager("Carl Cracker", 80000, 1987, 12, 15);

Manager boss = new Manager("Carl Cracker", 80000, 1987, 12, 15);

boss.setBonus(5000);

System.out.println("boss.toString(): " + boss);

System.out.println("carl.equals(boss): " + carl.equals(boss));

System.out.println("alice1.hashCode(): " + alice1.hashCode());

System.out.println("alice3.hashCode(): " + alice3.hashCode());

System.out.println("bob.hashCode(): " + bob.hashCode());

System.out.println("carl.hashCode(): " + carl.hashCode());

}

}

5.9代码:

package equals;

import java.time.*;

import java.util.Objects;

public class Employee

{

private String name;

private double salary;

private LocalDate hireDay;

public Employee(String name, double salary, int year, int month, int day)

{

this.name = name;

this.salary = salary;

hireDay = LocalDate.of(year, month, day);

}

public String getName()

{

return name;

}

public double getSalary()

{

return salary;

}

public LocalDate getHireDay()

{

return hireDay;

}

public void raiseSalary(double byPercent)

{

double raise = salary * byPercent / 100;

salary += raise;

}

public boolean equals(Object otherObject)

{

// a quick test to see if the objects are identical

if (this == otherObject) return true;

// must return false if the explicit parameter is null

if (otherObject == null) return false;

// if the classes don't match, they can't be equal

if (getClass() != otherObject.getClass()) return false;

// now we know otherObject is a non-null Employee

Employee other = (Employee) otherObject;

// test whether the fields have identical values

return Objects.equals(name, other.name)

&& salary == other.salary && Objects.equals(hireDay, other.hireDay);

}

public int hashCode()

{

return Objects.hash(name, salary, hireDay);

}

public String toString()

{

return getClass().getName() + "[name=" + name + ",salary=" + salary + ",hireDay="

+ hireDay + "]";

}

}

5.10代码:

package equals;

public class Manager extends Employee

{

private double bonus;

public Manager(String name, double salary, int year, int month, int day)

{

super(name, salary, year, month, day);

bonus = 0;

}

public double getSalary()

{

double baseSalary = super.getSalary();

return baseSalary + bonus;

}

public void setBonus(double bonus)

{

this.bonus = bonus;

}

public boolean equals(Object otherObject)

{

if (!super.equals(otherObject)) return false;

Manager other = (Manager) otherObject;

// super.equals checked that this and other belong to the same class

return bonus == other.bonus;

}

public int hashCode()

{

return java.util.Objects.hash(super.hashCode(), bonus);

}

public String toString()

{

return super.toString() + "[bonus=" + bonus + "]";

}

}

运行结果:

l  删除程序中Employee类、Manager类中的equals()、hasCode()、toString()方法,背录删除方法,在代码录入中理解类中重写Object父类方法的技术要点。

(1)代码

Employee类重写后代码如下:

package equals;

import java.time.*;

import java.util.Objects;

public class Employee

{

private String name;    //创建三个私有属性

private double salary;

private LocalDate hireDay;

public Employee(String name, double salary, int year, int month, int day)

{

this.name = name;

this.salary = salary;

hireDay = LocalDate.of(year, month, day);

}

public String getName()

{

return name;

}

public double getSalary()

{

return salary;

}

public LocalDate getHireDay()

{

return hireDay;

}

public void raiseSalary(double byPercent)

{

double raise = salary * byPercent / 100;   //定义局部变量

salary += raise;

}

@Override

public int hashCode() {   //重写hashCode方法,使相等的两个对象获取的HashCode也相等

// TODO Auto-generated method stub

return Objects.hash(name, salary, hireDay);

}

@Override

public boolean equals(Object obj) {

// TODO Auto-generated method stub

if (this == obj) return true;     //快速测试几个类的根是否相同,即是否是同一个超类。这个if语句判断两个引用是否是同一个,如果是同一个,那么这两个对象肯定相等。

if (obj == null) return false;   //如果显示参数为空,则返回false

if (getClass() !=obj.getClass()) return false;   //用getClass()方法得到对象的类。如果几个类不匹配,则它们不相等

//其他对象是非空Employee类

//在以上判断完成,再将得到的参数对象强制转换为该对象,考虑到父类引用子类的对象的出现,然后再判断对象的属性是否相同

Employee other = (Employee) obj;

//测试字段是否具有相同的值

return Objects.equals(name, other.name) && salary == other.salary && Objects.equals(hireDay, other.hireDay);

}

@Override

public String toString() {  //把其他类型的数据转为字符串类型的数据(toString方法可以自动生成)

// TODO Auto-generated method stub

return getClass().getName() + "[name=" + name + ",salary=" + salary + ",hireDay=" + hireDay + "]";

}

}

Manager类重写之后代码如下:

package equals;

public class Manager extends Employee     //子类:Manager类继承Employee类

{

private double bonus;     //创建私有属性bouns

public Manager(String name, double salary, int year, int month, int day)

{

super(name, salary, year, month, day);    //子类直接调用超类中已创建的属性

bonus = 0;      //给bouns赋初值为空

}

public double getSalary()//访问器

{

double baseSalary = super.getSalary();

return baseSalary + bonus;

}

public void setBonus(double bonus)   //更改器

{

this.bonus = bonus;

}

public boolean equals(Object otherObject)   //快速测试几个类的根是否相同,即是否是同一个超类

{

if (!super.equals(otherObject)) return false;

Manager other = (Manager) otherObject;

//使用super.equals检查这个类和其他是否属于同一个类

return bonus == other.bonus;

}

public int hashCode()    //重写hashCode方法,使相等的两个对象获取的HashCode也相等

{

return java.util.Objects.hash(super.hashCode(), bonus);

}

public String toString()    //把其他类型的数据转为字符串类型的数据(toString方法可以自动生成)

{

return super.toString() + "[bonus=" + bonus + "]";

}

}

EmployeeTest类代码如下:

package equals;

/**

* This program demonstrates the equals method.

* @version 1.12 2012-01-26

* @author Cay Horstmann

*/

public class EqualsTest

{

public static void main(String[] args)

{

Employee alice1 = new Employee("Alice Adams", 75000, 1987, 12, 15);

Employee alice2 = alice1;

Employee alice3 = new Employee("Alice Adams", 75000, 1987, 12, 15);

Employee bob = new Employee("Bob Brandson", 50000, 1989, 10, 1);

System.out.println("alice1 == alice2: " + (alice1 == alice2));

System.out.println("alice1 == alice3: " + (alice1 == alice3));

System.out.println("alice1.equals(alice3): " + alice1.equals(alice3));

System.out.println("alice1.equals(bob): " + alice1.equals(bob));

System.out.println("bob.toString(): " + bob);

Manager carl = new Manager("Carl Cracker", 80000, 1987, 12, 15);

Manager boss = new Manager("Carl Cracker", 80000, 1987, 12, 15);

boss.setBonus(5000);

System.out.println("boss.toString(): " + boss);

System.out.println("carl.equals(boss): " + carl.equals(boss));

System.out.println("alice1.hashCode(): " + alice1.hashCode());

System.out.println("alice3.hashCode(): " + alice3.hashCode());

System.out.println("bob.hashCode(): " + bob.hashCode());

System.out.println("carl.hashCode(): " + carl.hashCode());

}

}

(2)运行结果如下:

实验2:测试程序2

l  在elipse IDE中调试运行程序5-11(教材182页),结合程序运行结果理解程序;

l  掌握ArrayList类的定义及用法;

l  在程序中相关代码处添加新知识的注释;

5.11代码:

package arrayList;

import java.util.*;

/**

* This program demonstrates the ArrayList class.

* @version 1.11 2012-01-26

* @author Cay Horstmann

*/

public class ArrayListTest

{

public static void main(String[] args)

{

// fill the staff array list with three Employee objects

ArrayList staff = new ArrayList<Employee>();

staff.add(new Employee("Carl Cracker", 75000, 1987, 12, 15));

staff.add(new Employee("Harry Hacker", 50000, 1989, 10, 1));

staff.add(new Employee("Tony Tester", 40000, 1990, 3, 15));

// raise everyone's salary by 5%

for (Employee e : staff)

e.raiseSalary(5);

// print out information about all Employee objects

for (Employee e : staff)

System.out.println("name=" + e.getName() + ",salary=" + e.getSalary() + ",hireDay="

+ e.getHireDay());

}

}

package arrayList;

import java.time.*;

public class Employee

{

private String name;

private double salary;

private LocalDate hireDay;

public Employee(String name, double salary, int year, int month, int day)

{

this.name = name;

this.salary = salary;

hireDay = LocalDate.of(year, month, day);

}

public String getName()

{

return name;

}

public double getSalary()

{

return salary;

}

public LocalDate getHireDay()

{

return hireDay;

}

public void raiseSalary(double byPercent)

{

double raise = salary * byPercent / 100;

salary += raise;

}

}

运行结果:

l  设计适当的代码,测试ArrayList类的set()、get()、remove()、size()等方法的用法。

代码为:

package arrayList;

import java.util.*;

/**

* This program demonstrates the ArrayList class.

* @version 1.11 2012-01-26

* @author Cay Horstmann

*/

public class ArrayListTest

{

private static final Employee element = null;

private static final int index = 0;

public static void main(String[] args)

{

// fill the staff array list with three Employee objects

ArrayList<Employee> staff = new ArrayList<Employee>();   //用三个Employee对象填充数组

staff.add(new Employee("Carl Cracker", 75000, 1987, 12, 15));

staff.add(new Employee("Harry Hacker", 50000, 1989, 10, 1));

staff.add(new Employee("Tony Tester", 40000, 1990, 3, 15));

ArrayList<Employee> list = new ArrayList<Employee>();

//size()的用法

int size=staff.size();

System.out.println("arrayList中的元素个数是:"+size);

for(int i=0;i<staff.size();i++)

{

//get()的用法

Employee e=staff.get(i);

System.out.println("name=" + e.getName() + ",salary=" + e.getSalary() + ",hireDay="

+ e.getHireDay());

}

//set()的用法

staff.set(0, new Employee("llx", 20000, 1999, 11, 06));

Employee e=staff.get(0);

System.out.println("修改后的数据为:name=" + e.getName() + ",salary=" + e.getSalary() + ",hireDay="

+ e.getHireDay());

//remove()的用法

staff.remove(2);

System.out.println("将第一个数据删除后:");

int size1=staff.size();

System.out.println("arrayList中的元素个数是:"+size1);

for(int i=0;i<staff.size();i++)

{

Employee p=staff.get(i);

System.out.println("name=" + p.getName() + ",salary=" + p.getSalary() + ",hireDay="

+ p.getHireDay());

}

// raise everyone's salary by 5%

for (Employee e1 : staff)    //把每个人的薪资提高%5

e1.raiseSalary(5);

// print out information about all Employee objects

for (Employee e1 : staff)   //输出所有雇员对象的信息

System.out.println("name=" + e1.getName() + ",salary=" + e1.getSalary() + ",hireDay="

+ e1.getHireDay());    //利用getName(),getSalary() 和getHireDay()方法输出所有雇员对象的信息

}

}

运行结果:

实验2:测试程序3

l  编辑、编译、调试运行程序5-12(教材189页),结合运行结果理解程序;

l  掌握枚举类的定义及用法;

l  在程序中相关代码处添加新知识的注释;

代码为:

package enums;

import java.util.*;

/**

* This program demonstrates enumerated types.

* @version 1.0 2004-05-24

* @author Cay Horstmann

*/

public class EnumTest

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

System.out.print("Enter a size: (SMALL, MEDIUM, LARGE, EXTRA_LARGE) ");

String input = in.next().toUpperCase();

Size size = Enum.valueOf(Size.class, input);

System.out.println("size=" + size);

System.out.println("abbreviation=" + size.getAbbreviation());

if (size == Size.EXTRA_LARGE)

System.out.println("Good job--you paid attention to the _.");

}

}

enum Size

{

SMALL("S"), MEDIUM("M"), LARGE("L"), EXTRA_LARGE("XL");

private Size(String abbreviation) { this.abbreviation = abbreviation; }

public String getAbbreviation() { return abbreviation; }

private String abbreviation;

}

运行结果为:

l  删除程序中Size枚举类,背录删除代码,在代码录入中掌握枚举类的定义要求。

代码为:

package enums;

import java.util.*;

/**

* This program demonstrates enumerated types.

* @version 1.0 2004-05-24

* @author Cay Horstmann

*/

public class EnumTest

{

public static void main(String[] args)

{

var in = new Scanner(System.in);

System.out.print("Enter a size: (SMALL, MEDIUM, LARGE, EXTRA_LARGE) ");

String input = in.next().toUpperCase();

Size size = Enum.valueOf(Size.class, input);  //静态values方法返回枚举的所有值的数组

System.out.println("size=" + size);

System.out.println("abbreviation=" + size.getAbbreviation());

if (size == Size.EXTRA_LARGE)

System.out.println("Good job--you paid attention to the _.");

}

}

enum Size

{

SMALL("S"), MEDIUM("M"), LARGE("L"), EXTRA_LARGE("XL");

private Size(String abbreviation) { this.abbreviation = abbreviation; }

public String getAbbreviation() { return abbreviation; }

private String abbreviation;

}//调用构造函数

运行结果为:

实验2:测试程序4

录入以下代码,结合程序运行结果了解方法的可变参数用法

public class TestVarArgus {

public static void dealArray(int... intArray){

for (int i : intArray)

System.out.print(i +" ");

System.out.println();

}

public static void main(String args[]){

dealArray();

dealArray(1);

dealArray(1, 2, 3);

}

}

代码为:

public class TestVarArgus {

public static void dealArray(int... intArray){

for (int i : intArray)

System.out.print(i +" ");

System.out.println();

}

public static void main(String args[]){

dealArray();

dealArray(1);

dealArray(1, 2, 3);

}

}

运行结果:

实验3:编程练习

参照输出样例补全程序,使程序输出结果与输出样例一致。

public class Demo {

public static void main(String[] args) {

Son son = new Son();

son.method();

}

}

class Parent {

Parent() {

System.out.println("Parent's Constructor without parameter");

}

Parent(boolean b) {

System.out.println("Parent's Constructor with a boolean parameter");

}

public void method() {

System.out.println("Parent's method()");

}

}

class Son extends Parent {

//补全本类定义

}

程序运行结果如下:

Parent's Constructor with a boolean parameter

Son's Constructor without parameter

Son's method()

Parent's method()

代码为:

public class TestVarArgus {

public static void dealArray(int... intArray){

for (int i : intArray)

System.out.print(i +" ");

System.out.println();

}

public static void main(String args[]){

dealArray();

dealArray(1);

dealArray(1, 2, 3);

}

}

运行结果为:

3. 实验总结:(15分)

本次试验学习了访问修饰符有四种public protected 默认的不写的 private,public 访问权限最大,同包(同文件夹)里面的类绝对是可以互相访问的,不同包中的类只要经过import得到了路径后也是可以通过类的对象访问的,protected 和 默认的比public访问权限都要小(不能在其他包中被访问除非继承这里是指protected)但他们两之间有细微的区别就是在不同包中的类继承protected和 默认的时候 ,继承的类能够访问用protected修饰的成员而不能访问默认即不写修饰符的成员,private 范围最小 只能在类内部的成员之间进行访问,外部的类是绝对没有办法通过对象访问到私有成员的,继承的类也不会继承private的成员在Java中,ArrayList类可以解决运行时动态更改数组的问题。ArrayList使用起来有点像数组,但是在添加或删除元素时,具有自动调节数组容量的功能,而不需要为此编写任何代码。在今后的学习中要多思考,多去理解代码,理解各种参数的使用方法。多进行编程练习,以提高编程能力。

201871020225-牟星源《面向对象程序设计(java)》第七周学习总结的更多相关文章

  1. 201771010134杨其菊《面向对象程序设计java》第九周学习总结

                                                                      第九周学习总结 第一部分:理论知识 异常.断言和调试.日志 1.捕获 ...

  2. 201871010132-张潇潇《面向对象程序设计(java)》第一周学习总结

    面向对象程序设计(Java) 博文正文开头 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cn ...

  3. 扎西平措 201571030332《面向对象程序设计 Java 》第一周学习总结

    <面向对象程序设计(java)>第一周学习总结 正文开头: 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 ...

  4. 杨其菊201771010134《面向对象程序设计Java》第二周学习总结

    第三章 Java基本程序设计结构 第一部分:(理论知识部分) 本章主要学习:基本内容:数据类型:变量:运算符:类型转换,字符串,输入输出,控制流程,大数值以及数组. 1.基本概念: 1)标识符:由字母 ...

  5. 201871010124 王生涛《面向对象程序设计JAVA》第一周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://edu.cnblogs.com/campus/xbsf/ ...

  6. 201871010115——马北《面向对象程序设计JAVA》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  7. 201777010217-金云馨《面向对象程序设计(Java)》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  8. 201871010132——张潇潇《面向对象程序设计JAVA》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  9. 201771010123汪慧和《面向对象程序设计Java》第二周学习总结

    一.理论知识部分 1.标识符由字母.下划线.美元符号和数字组成, 且第一个符号不能为数字.标识符可用作: 类名.变量名.方法名.数组名.文件名等.第二部分:理论知识学习部分 2.关键字就是Java语言 ...

  10. 201521123061 《Java程序设计》第七周学习总结

    201521123061 <Java程序设计>第七周学习总结 1. 本周学习总结 2. 书面作业 ArrayList代码分析 1.1 解释ArrayList的contains源代码 贴上源 ...

随机推荐

  1. CF812C Sagheer and Nubian Market

    CF812C Sagheer and Nubian Market 洛谷评测传送门 题目描述 On his trip to Luxor and Aswan, Sagheer went to a Nubi ...

  2. rabbit 发送者设置

    @Override public void sendUploadOssAndRiskDanger(String uuid, Object objectData) { try { rabbitTempl ...

  3. json数据转换成结构体

    package main import ( "encoding/json" "fmt" ) type IT1 struct { Company string ` ...

  4. 关于 Noip的考纲

    关于 \(\text{Noip}\) 的考纲 先放一张图 : 此图包含了 \(\text{Noip}\) 自开始到结束 的所有真题的考察知识点 算法分类标准主要来自于 \(\text{Luogu}\) ...

  5. [LOJ 6432][PKUSC 2018]真实排名

    [LOJ 6432][PKUSC 2018]真实排名 题意 给定 \(n\) 个选手的成绩, 选中其中 \(k\) 个使他们的成绩翻倍. 对于每个选手回答有多少种方案使得他的排名不发生变化. \(n\ ...

  6. Spark SQL中出现 CROSS JOIN 问题解决

    Spark SQL中出现 CROSS JOIN 问题解决 1.问题显示如下所示:     Use the CROSS JOIN syntax to allow cartesian products b ...

  7. powersploit简介

    一.PowerSploit简介 PowerSploit是GitHub上面的一个安全项目,上面有很多powershell攻击脚本,它们主要被用来渗透中的信息侦察.权限提升.权限维持. Powershel ...

  8. 【转】Python zip() 函数

    转自:http://www.runoob.com/python/python-func-zip.html 描述 zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回 ...

  9. Kubernetes容器集群管理环境 - Node节点的移除与加入

    一.如何从Kubernetes集群中移除Node比如从集群中移除k8s-node03这个Node节点,做法如下: 1)先在master节点查看Node情况 [root@k8s-master01 ~]# ...

  10. Kubernetes 动态PV使用

    Kubernetes 动态PV使用 Kubernetes支持动态供给的存储插件:https://kubernetes.io/docs/concepts/storage/storage-classes/ ...