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

news2024/11/25 6:46:01

面向对象编程练习题

第一题

定义一个 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. 当调用对象的属性时,没有动态绑定机制,哪里声明,哪里使用。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用slenium对不同元素进行定位实战篇~

单选框Radio定位&#xff1a; 单选框只能点击一个&#xff0c;并且点击之后并不会被取消&#xff0c;而多选框&#xff0c;能够点击多个&#xff0c;并且点击之后可以取消 import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; imp…

基于python和opencv实现边缘检测程序

引言 图像处理是计算机视觉中的一个重要领域&#xff0c;它在许多应用中扮演着关键角色&#xff0c;如自动驾驶、医疗图像分析和人脸识别等。边缘检测是图像处理中的基本任务之一&#xff0c;它用于识别图像中的显著边界。本文将通过一个基于 Python 和 OpenCV 的示例程序&…

intellij idea安装R包ggplot2报错问题求解

1、intellij idea安装R包ggplot2问题 在我上次解决图形显示问题后&#xff0c;发现安装ggplot2包时出现了问题&#xff0c;这在之前高版本中并没有出现问题&#xff0c; install.packages(ggplot2) ERROR: lazy loading failed for package lifecycle * removing C:/Users/V…

Android 10.0 关于定制自适应AdaptiveIconDrawable类型的动态时钟图标的功能实现系列二(拖动到文件夹部分功能实现)

1.前言 在10.0的系统rom定制化开发中,在关于定制动态时钟图标中,原系统是不支持动态时钟图标的功能,所以就需要从新 定制动态时钟图标关于自适应AdaptiveIconDrawable类型的样式,就是可以支持当改变系统图标样式变化时,动态时钟 图标的背景图形也跟着改变,本篇实现在拖…

HBuilder X 小白日记02-布局和网页背景颜色

html&#xff1a; 例子1&#xff1a; 整个&#xff1a; css案例&#xff1a; 1.首先右键&#xff0c;创建css文件 2.在html文件的头部分&#xff0c;引用css&#xff0c;快捷方式&#xff1a;linkTab键 <link rel"stylesheet" href" "> 3.先在css…

操作系统精选题(二)(综合模拟题一)

&#x1f308; 个人主页&#xff1a;十二月的猫-CSDN博客 &#x1f525; 系列专栏&#xff1a; &#x1f3c0;操作系统 &#x1f4aa;&#x1f3fb; 十二月的寒冬阻挡不了春天的脚步&#xff0c;十二点的黑夜遮蔽不住黎明的曙光 目录 前言 简答题 一、进程由计算和IO操作组…

论文阅读之旋转目标检测ARC:《Adaptive Rotated Convolution for Rotated Object Detection》

论文link&#xff1a;link code&#xff1a;code ARC是一个改进的backbone&#xff0c;相比于ResNet&#xff0c;最后的几层有一些改变。 Introduction ARC自适应地旋转以调整每个输入的条件参数&#xff0c;其中旋转角度由路由函数以数据相关的方式预测。此外&#xff0c;还采…

【Unity】Timeline的倒播和修改速度(无需协程)

unity timeline倒播 一、核心&#xff1a; 通过playableDirector.playableGraph.GetRootPlayable(i).SetSpeed(speed)接口&#xff0c;设置PlayableDirector的速度。 二、playableGraph报空 若playableDirector不勾选Play On Awake&#xff0c;则默认没有PlayableGraph&…

Redis基础教程(三):redis命令

&#x1f49d;&#x1f49d;&#x1f49d;首先&#xff0c;欢迎各位来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里不仅可以有所收获&#xff0c;同时也能感受到一份轻松欢乐的氛围&#xff0c;祝你生活愉快&#xff01; &#x1f49d;&#x1f49…

oj E : 投资项目的方案

Description 有n种基础的投资项目&#xff0c;每一种的单位收益率为profitn&#xff0c;存在m种投资组合&#xff0c;限制每一种的投资总额不能超过invest_summ 每种投资组合中项目所需的单位投入是不同的&#xff0c;为costmn 求&#xff1a;使得收益率之和最高的每种项目投…

Meven

目录 1.简介2.Maven项目目录结构2.1 约定目录结构的意义2.2 约定大于配置 3. POM.XML介绍3.2 依赖引用3.3 属性管理 4 Maven生命周期4.1 经常遇到的生命周期4.1 全部生命周期 5.依赖范围&#xff08;Scope&#xff09;6. 依赖传递6.1 依赖冲突6.2 解决依赖冲突6.2.1 最近依赖者…

1、线性回归模型

1、主要解决问题类型 1.1 预测分析(Prediction) 线性回归可以用来预测一个变量(通常称为因变量或响应变量)的值,基于一个或多个输入变量(自变量或预测变量)。例如,根据房屋的面积、位置等因素预测房价。 1.2 异常检测(Outlier Detection) 线性回归可以帮助识别数…

vscode-创建vue3项目-修改暗黑主题-常见错误-element插件标签-用法涉及问题

文章目录 1.vscode创建运行编译vue3项目2.添加项目资源3.添加element-plus元素4.修改为暗黑主题4.1.在main.js主文件中引入暗黑样式4.2.添加自定义样式文件4.3.html页面html标签添加样式 5.常见错误5.1.未使用变量5.2.关闭typescript检查5.3.调试器支持5.4.允许未到达代码和未定…

量产工具一一显示系统(一)

目录 前言 一、项目介绍和应用 1.简单易用 2.软件可配置、易扩展 3.纯 C 语言编程 4.类似界面应用 二、项目总体框架 三、显示系统 1.显示系统数据结构抽象 &#xff08;1&#xff09;common.h &#xff08;2&#xff09;disp_manager.h 2.Framebuffer编程 &#x…

Conformal Prediction

1 A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification 2 Language Models with Conformal Factuality Guarantees

《数据结构与算法基础 by王卓老师》学习笔记——类C语言有关操作补充

1.元素类型说明 2.数组定义 3.C语言的内存动态分配 4..C中的参数传递 5.传值方式 6.传地址方式 例子

grpc学习golang版( 一、基本概念与安装 )

系列文章目录 第一章 grpc基本概念与安装 第二章 grpc入门示例 第三章 proto文件数据类型 第四章 多服务示例 第五章 多proto文件示例 第六章 服务器流式传输 第七章 客户端流式传输 第八章 双向流示例 文章目录 一、基本介绍1.1 什么是rpc1.2 什么是grpc1.3 grpc的作用1.4 grp…

Django之邮箱注册

目录 一、邮箱验证-环境搭建 1.1、注册流程 1.2、环境搭建 二、封装工具类 三、发送邮件接口开发 四、用户调用发送邮件接口 4.1、Fetch API 4.1.1、GET请求 4.1.2、POST请求 五、完成注册功能 一、邮箱验证-环境搭建 1.1、注册流程 1.2、环境搭建 创建项目 django-a…

4 快速傅里叶变换(fast Fourier transform,FFT)

目录 基2FFT的基本原理&#xff0c;蝶形运算符 第L级旋转因子的计算公式 4点与8点鲽形图 确定输入x(n)的顺序 倒序算法 抽样算法 DFT与FFT运算次数公式 基2FFT的基本原理&#xff0c;蝶形运算符 第L级旋转因子的计算公式 4点与8点鲽形图 确定输入x(n)的顺序 倒序算法 1…

Java开发-实际工作经验和技巧-0003-容易被忽视的Git提交代码规范

Java开发-实际工作经验和技巧-0003-容易被忽视的Git提交代码规范 更多内容欢迎关注我&#xff08;持续更新中&#xff0c;欢迎Star✨&#xff09; Github&#xff1a;CodeZeng1998/Java-Developer-Work-Note 技术公众号&#xff1a;CodeZeng1998&#xff08;纯纯技术文&…