java第三十课 —— 面向对象练习题

面向对象编程练习题

第一题

定义一个 Person 类 {name, age, job},初始化 Person 对象数组,有 3 个 person 对象,并按照 age 从大到小进行排序,提示,使用冒泡排序。

package com.hspedu.homework;

import java.util.SortedMap;

public class Homework01 {
    public static void main(String[] args) {

        Person[] persons = new Person[3];
        persons[0] = new Person("Tom", 20, "student");
        persons[1] = new Person("Jack", 18, "worker");
        persons[2] = new Person("Smith", 19, "singer");
        //输出当前对象数组
        System.out.println("当前对象数组:");
        for(int i = 0; i < persons.length; i++){
            System.out.println(persons[i]);
        }
        //使用冒泡排序
        for(int i = 0; i < persons.length - 1; i++){
            for(int j = 0; j <persons.length - i - 1; j++){
                if(persons[j].getAge() < persons[j + 1].getAge()){
                    Person temp = persons[j];
                    persons[j] = persons[j + 1];
                    persons[j + 1] = temp;
                }
            }
        }
        System.out.println("对象数组按照年龄(从大到小)排序后:");
        for(int i = 0; i < persons.length; i++){
            System.out.println(persons[i]);
        }
    }
}
class Person{
    private String name;
    private int age;
    private String job;

    public Person(String name, int age, String job) {
        this.name = name;
        this.age = age;
        this.job = job;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", job='" + job + '\'' +
                '}';
    }
}

第二题

写出四种访问修饰符和各自的访问权限。

在这里插入图片描述

第三题

编写老师类。

在这里插入图片描述

Homework03.java:

package com.hspedu.homework;

public class Homework03 {
    public static void main(String[] args) {
        Teacher[] teachers = new Teacher[3];
        teachers[0] = new Professor("John", 50, "教授", 30000, 1.3);
        teachers[1] = new FProfessor("Tom", 40, "副教授", 20000, 1.2);
        teachers[2] = new JiangShi("Mary", 30, "讲师", 10000, 1.1);
        for(int i = 0; i < teachers.length; i++){
            teachers[i].introduce();
        }
    }
}

Teacher.java:

package com.hspedu.homework;

public class Teacher{
    private String name;
    private int age;
    private String post;
    private double salary;
    private double grade;

    public Teacher(String name, int age, String post, double salary, double grade) {
        this.name = name;
        this.age = age;
        this.post = post;
        this.salary = salary;
        this.grade = grade;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public double getGrade() {
        return grade;
    }

    public void setGrade(double grade) {
        this.grade = grade;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", post='" + post + '\'' +
                ", salary=" + salary +
                ", grade=" + grade +
                '}';
    }

    public void introduce(){
        System.out.println(toString());
    }
}

Professor.java:

package com.hspedu.homework;

public class Professor extends Teacher{
    public Professor(String name, int age, String post, double salary, double grade) {
        super(name, age, post, salary,grade);
    }
    @Override
    public void introduce() {
        System.out.println("这是教授信息:");
        super.introduce();
    }
}

FProfessor.java:

package com.hspedu.homework;

public class FProfessor extends Teacher{
    public FProfessor(String name, int age, String post, double salary, double grade) {
        super(name, age, post, salary, grade);
    }

    @Override
    public void introduce() {
        System.out.println("这是副教授信息:");
        super.introduce();
    }
}

JiangShi.java:

package com.hspedu.homework;

public class JiangShi extends Teacher{
    public JiangShi(String name, int age, String post, double salary, double grade) {
        super(name, age, post, salary, grade);
    }

    @Override
    public void introduce() {
        System.out.println("这是讲师信息:");
        super.introduce();
    }
}

第四题

通过继承实现员工工资核算打印功能。

在这里插入图片描述

Homework04.java:

package com.hspedu.homework.homework04;

public class Homework04 {
    public static void main(String[] args) {
        Manager john = new Manager("John", 100, 30, 1.2);
        Worker tom = new Worker("Tom", 60, 30, 1.0);
        john.setBonus(1000);
        john.show();
        tom.show();
    }
}

Employee.java:

package com.hspedu.homework.homework04;

public class Employee {
    private String name;
    private double salary;
    private int days;
    private double grade;

    public Employee(String name, double salary, int days, double grade) {
        this.name = name;
        this.salary = salary;
        this.days = days;
        this.grade = grade;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public double getSalary() {
        return salary;
    }
    public void setSalary(double salary) {
        this.salary = salary;
    }
    public int getDays() {
        return days;
    }
    public void setDays(int days) {
        this.days = days;
    }
    public double getGrade() {
        return grade;
    }
    public void setGrade(double grade) {
        this.grade = grade;
    }
    public void show(){
        System.out.println(name + " 的工资为:" + salary);
    }
}

Worker.java:

package com.hspedu.homework.homework04;

public class Worker extends Employee{
    public Worker(String name, double salary, int days, double grade) {
        super(name, salary, days, grade);
    }

    @Override
    public void show() {
        System.out.print("普通员工 ");
        setSalary(getSalary() * getDays() * getGrade());
        super.show();
    }
}

Manager.java:

package com.hspedu.homework.homework04;

public class Manager extends Employee{
    private double bonus;
    public Manager(String name, double salary, int days, double grade) {
        super(name, salary, days, grade);
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void show() {
        System.out.print("经理 ");
        setSalary(bonus + getSalary() * getDays() * getGrade());
        super.show();
    }
}

第五题

设计父类——员工类。子类:工人类,农民类,教师类,科学家类,服务生类。

在这里插入图片描述

Homework05.java:

package com.hspedu.homework.homework05;

public class Homework05 {
    public static void main(String[] args) {
        Employee[] employees = new Employee[3];
        employees[0] = new Worker("张三", 3000);
        employees[1] = new Farmer("小李", 2000);
        employees[2] = new Waiter("丽丽", 2500);
        Teacher tom = new Teacher("Tom", 5000);
        Scientist liu = new Scientist("LIU", 20000);
        for(int i = 0; i < 3; i++){
            employees[i].setMonth(12);//设置薪资月份
            employees[i].show();
        }

        tom.setMonth(13);//十三薪
        tom.setBonus(10);//课时费
        tom.setDays(100);//上了多少天课
        tom.show();

        liu.setMonth(15);//十五新
        liu.setBonus(100000);//年终奖金
        liu.show();
    }
}

Employee.java:

package com.hspedu.homework.homework05;

public class Employee {
    private String name;
    private double salary;
    private int month;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public Employee(String name, double salary) {

        this.name = name;
        this.salary = salary;
    }
    public void show(){
        System.out.println(name + " 的全年工资为:" + salary);
    }

}

Worker.java:

package com.hspedu.homework.homework05;

public class Worker extends Employee{
    public Worker(String name, double salary) {
        super(name, salary);
    }

    @Override
    public void show() {
        System.out.print("工人 ");
        setSalary(getSalary() * getMonth());
        super.show();
    }
}

Waiter.java:

package com.hspedu.homework.homework05;

public class Waiter extends Employee{
    public Waiter(String name, double salary) {
        super(name, salary);
    }

    @Override
    public void show() {
        System.out.print("服务生 ");
        setSalary(getSalary() * getMonth());
        super.show();
    }
}

Farmer.java:

package com.hspedu.homework.homework05;

public class Farmer extends Employee{
    public Farmer(String name, double salary) {
        super(name, salary);
    }

    @Override
    public void show() {
        System.out.print("农民 ");
        setSalary(getSalary() * getMonth());
        super.show();
    }
}

Teacher.java:

package com.hspedu.homework.homework05;

public class Teacher extends Employee{
    private int days;
    private double bonus;
    public Teacher(String name, double salary) {
        super(name, salary);
    }

    public int getDays() {
        return days;
    }

    public void setDays(int days) {
        this.days = days;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void show() {
        System.out.print("老师 ");
        setSalary(getSalary() * getMonth() + days * bonus);
        super.show();
    }
}

Scientist.java:

package com.hspedu.homework.homework05;

public class Scientist extends Employee{
    private double bonus;
    public Scientist(String name, double salary) {
        super(name, salary);
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void show() {
        System.out.print("科学家 ");
        setSalary(getSalary() * getMonth() + bonus);
        super.show();
    }
}

第六题

在父类和子类中通过 this 和 super 都可以调用哪些属性和方法,假定Grand、Father 和 Son 在同一个包。

class Grand{//超类
	String name = "AA";
	private int age = 100;
	public void g1(){
	
	}
}
class Father extends Grand{//父类
    String id = "001";
    private double score;
    public void f1(){
    //super 可以访问哪些成员(属性和方法)?super.name;super.g1(); 
    //this 可以访问哪些成员?this.id;this.score;this.f1();this.name;this.g1();
    }
}
class Son extends Father{//子类
    String name = "BB";
    public void g1(){
        
    }
    private void show(){
    //super 可以访问哪些成员(属性和方法)?super.id;super.f1();super.name;super.g1(); 
    //this 可以访问哪些成员? this.name;this.g1();this.id;this.f1();
    }
}

第七题

答案:

Test;Demo;Rose;Jack;

john;Jack;

在这里插入图片描述

第八题

扩展如下的 BankAccount 类。

class BankAccount{
    private double balance;
    public BankAccount(double initialBalance){
		this.balance = initialBalance;
    }
    public void deposit(double amount){
        balance += amount;
    }
    public void withdraw(double amount){
        balance -= amount;
    }
}

要求:

  1. 在上面类的基础上扩展,新类 CheckingAccount 对每次存款和取款都收取1美元的手续费。
  2. 扩展前一个练习的 BankAccount 类,新类 SavingsAccount 每个月都有利息产生 ( earnMonthlyInterest 方法被调用),并且有每月三次免手续费的存款或取款。在 earnMonthlyInterest 方法中重置交易计数。

Homework08.java:

package com.hspedu.homework.homework08;

public class Homework08 {
    public static void main(String[] args) {
//        CheckingAccount checkingAccount = new CheckingAccount(1000);
//        checkingAccount.deposit(10);//1000+10-1 = 1009
//        checkingAccount.withdraw(10);//1009-10-1 = 998
//        System.out.println(checkingAccount.getBalance());
        SavingsAccount savingsAccount = new SavingsAccount(1000);
        savingsAccount.deposit(100);//1000+100=1100
        savingsAccount.deposit(100);//1100+100=1200
        savingsAccount.deposit(100);//1200+100=1300
        System.out.println(savingsAccount.getBalance());
        savingsAccount.deposit(100);//1300+100-1=1399
        System.out.println(savingsAccount.getBalance());
        //月初,定时器自动调用一下 earnMonthlyInterest
        savingsAccount.earnMonthlyInterest();//1399*1.01=1412.99
        savingsAccount.deposit(100);//免手续费 1412.99+100=1512.99
        System.out.println(savingsAccount.getBalance());
        savingsAccount.withdraw(100);//免手续费 1512.99-100=1412.99
        savingsAccount.withdraw(100);//免手续费 1412.99-100=1312.99
        savingsAccount.deposit(100);//扣手续费  1312.99+100-1=1411.99
        System.out.println(savingsAccount.getBalance());
    }
}

BankAccount.java:

package com.hspedu.homework.homework08;

class BankAccount{
    private double balance;
    public BankAccount(double initialBalance){
        this.balance = initialBalance;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void deposit(double amount){
        balance += amount;

    }
    public void withdraw(double amount){
        balance -= amount;

    }
}

CheckingAccount.java:

package com.hspedu.homework.homework08;

public class CheckingAccount extends BankAccount{
    //属性


    public CheckingAccount(double initialBalance) {
        super(initialBalance);
    }

    @Override
    public void deposit(double amount) {
        super.deposit(amount - 1);
    }

    @Override
    public void withdraw(double amount) {
        super.withdraw(amount + 1);
    }
}

SavingsAccount.java:

package com.hspedu.homework.homework08;

public class SavingsAccount extends BankAccount{
    private int count = 3;
    private double rate = 0.01;//利率

    public SavingsAccount(double initialBalance) {
        super(initialBalance);
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    @Override
    public void deposit(double amount) {
        // 判断是否可以免手续费
        if(count > 0){
            super.deposit(amount);
        }else{
            super.deposit(amount - 1);
        }
        count--;
    }

    @Override
    public void withdraw(double amount) {
        if(count > 0){
            super.withdraw(amount);
        }else{
            super.withdraw(amount + 1);
        }
        count--;
    }
    public void earnMonthlyInterest(){
        count = 3;//每个月我们统计上个月利息,同时将count = 3
        super.deposit(getBalance() * rate);
    }
}

第九题

设计一个 Point 类,其 x 和 y 坐标可以通过构造器提供。提供一个子类 LabeledPoint,其构造器接受一个标签值和 x,y 坐标,比如:new LabeledPoint(“Black Thursday",1929,230.07),写出对应的构造器即可。

//Point类构造器
public class Point {
    private double x;
    private double y;

    public Point(double x, double y) {
        this.x = x;
        this.y = y;
    }
}
//LabeledPoint类构造器
public class LabeledPoint extends Point{
    private  String label;

    public LabeledPoint(String label, double x, double y) {
        super(x, y);
        this.label = label;
    }
}

第十题

编写 Doctor 类 {name, age,job, gender, sal} 相应的 getter() 和 setter() 方法,5个参数的构造器,重写父类的 equals()方法:public boolean equals(Obiect obj) 并判断测试类中创建的两个对象是否相等。相等就是判断属性是否相同。

Homework10.java:

package com.hspedu.homework.homework10;

public class Homework10 {
    public static void main(String[] args) {
        Doctor doctor = new Doctor("Tom", 18, "工人", '男', 5000);
        Doctor doctor1 = new Doctor("Tom", 18, "工人", '男', 5000);
        System.out.println(doctor.equals(doctor1));
    }
}

Doctor.java:

package com.hspedu.homework.homework10;

public class Doctor {
    private String name;
    private int age;
    private String job;
    private char gender;
    private double sal;

    public Doctor(String name, int age, String job, char gender, double sal) {
        this.name = name;
        this.age = age;
        this.job = job;
        this.gender = gender;
        this.sal = sal;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public double getSal() {
        return sal;
    }

    public void setSal(double sal) {
        this.sal = sal;
    }
    public boolean equals(Object obj){
        if(this == obj){
            return true;//判断两个对象是否相同
        }
        if(!(obj instanceof Doctor)){
            return false;//不是Doctor类型或其子类
        }
        //向下转型,因为obj的运行类型是Doctor类型或其子类
        Doctor doctor = (Doctor)obj;
        return this.name.equals(doctor.name) && this.age == doctor.age
                && this.job.equals(doctor.job) && this.gender == doctor.gender
                && this.sal == doctor.sal;
    }
}

第十一题

在这里插入图片描述

Homework11.java:

package com.hspedu.homework.homework11;

public class homework11 {
    public static void main(String[] args) {
        Person person = new Student("Tom");//向上转型
        person.run();
        person.eat();

        Student student = (Student)person;//向下转型
        student.run();
        student.study();
        student.eat();
    }
}

Person.java:

package com.hspedu.homework.homework11;

public class Person {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Person(String name) {
        this.name = name;
    }
    public void run(){
        System.out.println("person run");
    }
    public void eat(){
        System.out.println("person eat");
    }

}

Student.java:

package com.hspedu.homework.homework11;

public class Student extends Person{
    public Student(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println("student run");
    }
    public void study(){
        System.out.println("student study...");
    }
}

第十二题

说出 == 与 equals 的区别。

在这里插入图片描述

第十三题

在这里插入图片描述

Homework13.java:

package com.hspedu.homework.homework13;

public class Homework13 {
    public static void main(String[] args) {
        Person[] persons = new Person[4];
        persons[0] = new Student("小明", '男', 10, "00023102");
        persons[1] = new Student("小红", '女', 12, "00023101");
        persons[2] = new Teacher("Tom", '男', 30, 8);
        persons[3] = new Teacher("Mary", '女', 35, 10);

        System.out.println("==========排序前:==========");
        for(int i = 0; i < persons.length; i++){
            System.out.println(persons[i].toString());
            new Homework13().print(persons[i]);
            System.out.println(persons[i].play());
            System.out.println("--------------------------");
        }
        new Homework13().sort(persons);
        System.out.println("==========排序后:==========");
        for(int i = 0; i < persons.length; i++){
            System.out.println(persons[i].toString());
            new Homework13().print(persons[i]);
            System.out.println(persons[i].play());
            System.out.println("--------------------------");
        }
    }
    public void sort(Person[] persons){
        for(int i = 0; i < persons.length - 1; i++){
            for(int j = 0; j < persons.length - i - 1; j++){
                if(persons[j].getAge() < persons[j + 1].getAge()){//按年龄从高到低排序
                    Person temp = persons[j];
                    persons[j] = persons[j + 1];
                    persons[j + 1] = temp;
                }
            }
        }
    }
    public void print(Person person){
        if(!(person instanceof Teacher || person instanceof Student)){
            System.out.println("不是老师也不是学生");
        }
        if(person instanceof Student){
            ((Student) person).study();
        }
        if(person instanceof Teacher){
            ((Teacher) person).teach();
        }
    }
}

Person.java:

package com.hspedu.homework.homework13;

public class Person {
    private String name;
    private char sex;
    private int age;

    public Person(String name, char sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "姓名:" + name + "\n" +
                "年龄:" + sex + "\n" +
                "性别:" + age + "\n";
    }

    public String play(){
        return name + "爱玩";
    }
}

Teacher.java:

package com.hspedu.homework.homework13;

public class Teacher extends Person{
    private int work_age;

    public Teacher(String name, char sex, int age, int work_age) {
        super(name, sex, age);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }
    public void teach(){
        System.out.println("我承诺,我会认真教学。");
    }

    @Override
    public String toString() {
        return "老师的信息:\n" + super.toString() +
                "工龄:" + work_age;
    }

    @Override
    public String play() {
        return super.play() + "象棋。";
    }
}

Student.java:

package com.hspedu.homework.homework13;

public class Student extends Person{
    private String stu_id;

    public Student(String name, char sex, int age, String stu_id) {
        super(name, sex, age);
        this.stu_id = stu_id;
    }

    public String getStu_id() {
        return stu_id;
    }

    public void setStu_id(String stu_id) {
        this.stu_id = stu_id;
    }
    public void study(){
        System.out.println("我承诺,我会好好学习。");
    }

    @Override
    public String toString() {
        return "学生的信息:\n" + super.toString() +
        "学号:" + stu_id;
    }

    @Override
    public String play() {
        return super.play() + "足球。";
    }
}

第十四题

答案:我是A类;hahah我是B类的有参构造;我是c类的有参构造;我是c类的无参构造;

在这里插入图片描述

第十五题

什么是多态,多态具体体现有哪些?(可举例说明)

在这里插入图片描述

举例:

package com.hspedu.homework;

public class Homework15 {
    public static void main(String[] args) {
        AAA obj = new BBB();//向上转型
        AAA b1 = obj;
        System.out.println("obj的运行类型="+ obj.getClass());//BBB
        obj = new CCC();//向上转型
        System.out.println("obj的运行类型="+ obj.getClass());//CCC
        obj = b1;
        System.out.println("obj的运行类型="+ obj.getClass());//BBB
    }
}
class AAA{}
class BBB extends AAA{}
class CCC extends BBB{}

第十六题

java 的动态绑定机制是什么?

  1. 当调用对象的方法时,该方法会和对象的内存地址 / 运行类型绑定。
  2. 当调用对象的属性时,没有动态绑定机制,哪里声明,哪里使用。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/758923.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

LLM——10个大型语言模型(LLM)常见面试题以及答案解析

今天我们来总结以下大型语言模型面试中常问的问题 1、哪种技术有助于减轻基于提示的学习中的偏见? A.微调 Fine-tuning B.数据增强 Data augmentation C.提示校准 Prompt calibration D.梯度裁剪 Gradient clipping 答案:C 提示校准包括调整提示&#xff0c;尽量减少产生…

数据结构与算法笔记:实战篇 - 剖析Redis常用数据类型对应的数据结构

概述 从本章开始&#xff0c;就进入实战篇的部分。这部分主要通过一些开源醒目、经典系统&#xff0c;真枪实弹地教你&#xff0c;如何将数据结构和算法应用到项目中。所以这部分的内容&#xff0c;更多的是知识点的回顾&#xff0c;相对于基础篇和高级篇&#xff0c;其实这部…

【Web3项目案例】Ethers.js极简入门+实战案例:实现ERC20协议代币查询、交易

苏泽 大家好 这里是苏泽 一个钟爱区块链技术的后端开发者 本篇专栏 ←持续记录本人自学智能合约学习笔记和经验总结 如果喜欢拜托三连支持~ 目录 简介 前景科普-ERC20 Ethers极简入门教程&#xff1a;HelloVitalik&#xff08;非小白可跳&#xff09; 教程概览 开发工具 V…

虚拟机配置与windows之间文件夹共享samba服务:

虚拟机配置与windows之间文件夹共享samba服务: #输入安装命令&#xff1a; 第一步: 下载samba cd /etc/ sudo apt-get install samba第二步: 配置用户 sudo smbpasswd -a 虚拟机用户名第三步: 进入配置文件配置共享文件 sudo vim /etc/samba/smb.conf末尾输入以下内容: [s…

全球最大智能立体书库|北京:3万货位,715万册,自动出库、分拣、搬运

导语 大家好&#xff0c;我是社长&#xff0c;老K。专注分享智能制造和智能仓储物流等内容。 新书《智能物流系统构成与技术实践》 北京城市图书馆的立体书库采用了先进的WMS&#xff08;仓库管理系统&#xff09;和WCS&#xff08;仓库控制系统&#xff09;&#xff0c;与图书…

代码随想录-二叉搜索树(1)

目录 二叉搜索树的定义 700. 二叉搜索树中的搜索 题目描述&#xff1a; 输入输出示例&#xff1a; 思路和想法&#xff1a; 98. 验证二叉搜索树 题目描述&#xff1a; 输入输出示例&#xff1a; 思路和想法&#xff1a; 530. 二叉搜索树的最小绝对差 题目描述&#x…

error: Sandbox: rsync.samba in Xcode project

在Targets 的 Build Settings 搜索&#xff1a;User script sandboxing 设置为NO

基于机器学习的制冷系统过充电和欠充电故障诊断(采用红外热图像数据,MATLAB)

到目前为止&#xff0c;制冷系统故障诊断方法已经产生很多种&#xff0c;概括起来主要有三大类&#xff1a;基于分析的方法&#xff0c;基于知识的方法和基于数据驱动的方法。基于分析的方法主要获得制冷系统的数学模型&#xff0c;通过残差来检测和诊断故障。如果存在残差且很…

SonicSense:声学振动丰富机器人的物体感知能力

在通过声学振动进行物体感知方面&#xff0c;尽管以往的研究已经取得了一些有希望的结果&#xff0c;但目前的解决方案仍然受限于几个方面。首先&#xff0c;大多数现有研究集中在只有少数&#xff08;N < 5&#xff09;基本物体的受限设置上。这些物体通常具有均质材料组成…

电路笔记(电源模块): 基于FT2232HL实现的jtag下载器硬件+jtag的通信引脚说明

JTAG接口说明 JTAG 接口根据需求可以选择20针或14针的配置&#xff0c;具体选择取决于应用场景和需要连接的功能。比如之前的可编程逻辑器件XC9572XL使用JTAG引脚&#xff08;TCK、TDI、TDO、TMS、VREF、GND&#xff09;用于与器件进行调试和编程通信。更详细的内容可以阅读11…

KAIROS复现记录

KAIROS:使用全系统起源的实用入侵检测和调查 Github&#xff1a;https://github.com/ProvenanceAnalytics/kairos KAIROS: Practical Intrusion Detection and Investigation using Whole-system Provenance 1. 论文实验 实验部分使用SCISKIT-LEARN来实现分层特征散列&#xf…

硬核!大佬通过Intel CPU的JTAG接口,DUMP微软原始Xbox的加密BootROM。

这是一篇记录如何通过Intel CPU的JTAG接口,DUMP微软原始Xbox的加密BootROM的文章,内容也记录了老哥如何设计实现JTAG调试器的过程,非常硬核! 原文:JTAG ‘Hacking’ the Original Xbox in 2023 Using Intel CPU JTAG to dump the secret bootrom in Microsoft’s original…

Java代码基础算法练习-求成绩单中最高和第二高的成绩-2024.06.30

任务描述&#xff1a; 输入n(0<n<20)个整数代表成绩&#xff0c;求n个成绩中最高的和第二高成绩 解决思路&#xff1a; 输入的数字 n 为 for 循环的次数&#xff0c;在每次循环中进行值的输入和判断 如果当前输入的分数大于最大值&#xff0c;则更新最大值和次大值 如…

Golang-channel理解

channel golang-channel语雀笔记整理 channelgolang channel的设计动机&#xff1f;chanel的数据结构/设计思考 golang channel的设计动机&#xff1f; channel是一种不同协程之间实现异步通信的数据结构。golang中有一种很经典的说法是要基于通信实现共享内存&#xff0c;而不…

grpc教程——proto文件转go

【1】编写一个proto文件 syntax "proto3"; package myproto;service NC{rpc SayStatus (NCRequest) returns (NCResponse){} }message NCRequest{ string name 1; } message NCResponse{string status 1; } 【2】转换&#xff1a;protoc --go_out. myservice.pro…

重生奇迹MU 正确获取金币的方式

在游戏中&#xff0c;需要消耗大量的金币来购买红药等物品。因此&#xff0c;如何快速赚取金币也成为玩家关注的问题。您知道有哪些方法可以快速地获得金币吗&#xff1f; 一、哪个地图上是最适合打金币的很关键 在选择打钱的地方时&#xff0c;不能盲目行动&#xff0c;需要…

安装maven与nexus

安装maven与nexus Maven官网下载地址&#xff1a;http://maven.apache.org cd /data/software/wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.8.1/binaries/apache-maven-3.8.8-bin.tar.gz# 解压 tar xf apache-maven-3.8.1-bin.tar.gz -C /opt/[rooth…

木各力“GERRI”被“GREE”格力无效宣告成功

近日“GERRI”被“GREE”格力无效宣告成功&#xff0c;“GERRI”和“GREE”近似不&#xff0c;如果很近似当初就不会通过初审和下商标注册证&#xff0c;但是如果涉及知名商标和驰名商标&#xff0c;人家就可以异议和无效。 “GERRI”在被无效宣告时&#xff0c;引用了6个相关的…

【启明智显分享】乐鑫ESP32-S3R8方案2.8寸串口屏:高性能低功耗,WIFI/蓝牙无线通信

近年来HMI已经成为大量应用聚焦的主题&#xff0c;在消费类产品通过创新的HMI设计带来增强的连接性和更加身临其境的用户体验之际&#xff0c;工业产品却仍旧在采用物理接口。这些物理接口通常依赖小型显示器或是简单的LED&#xff0c;通过简单的机电开关或按钮来实现HMI交互。…

竞赛 深度学习 大数据 股票预测系统 - python lstm

文章目录 0 前言1 课题意义1.1 股票预测主流方法 2 什么是LSTM2.1 循环神经网络2.1 LSTM诞生 2 如何用LSTM做股票预测2.1 算法构建流程2.2 部分代码 3 实现效果3.1 数据3.2 预测结果项目运行展示开发环境数据获取 最后 0 前言 &#x1f525; 优质竞赛项目系列&#xff0c;今天…