class Test {public static void main(String[] args) {int i=1;System.out.println(getType(i));}public static String getType(Object o){return o.getClass().toString();}} public class Test15 { public static void main(String[] args) { int i=1; Integer i1 =…
1. 子类的构造函数假设要引用super的话,必须把super放在函数的首位. class Base { Base() { System.out.println("Base"); } } public class Checket extends Base { Checket() { super();//调用父类的构造方法.一定要放在方法的首个语句 System.out.println("Checket"); } public static void main…
例如 package com.atguigu.java.fanshe; public class Person { String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) {…