Java基础面试题(1)

  • 访问修饰符图

  • final 有什么用?

    不可修改 不可被重写(可以重载!) 不可继承

  • final finally finalize区别

  • super关键字的用法

class Person{
    protected String name;
 
    public Person(String name) {
        this.name = name;
    }
 
}
 
class Student extends Person{
    private String name;
 
    public Student(String name, String name1) {
        super(name);
        this.name = name1;
    }
 
    public void getInfo(){
        System.out.println(this.name); //Child
        System.out.println(super.name); //Father
    }
 
}

public class Test {
    public static void main(String[] args) {
       Student s1 = new Student("Father","Child");
       s1.getInfo();
    }
}

  • this与super的区别

  • 在 Java 中,如何跳出当前的多重嵌套循环

  • BIO,NIO,AIO 有什么区别?

  • 什么是反射机制?

posted @ 2021-10-11 10:10  offlineboy  阅读(27)  评论(0)    收藏  举报