当前位置:网站首页>不会初始化类的几种Case
不会初始化类的几种Case
2022-06-27 08:25:00 【C_x_330】
public class P {
public static int abc = 123;
static{
System.out.println("P is init");
}
}
public class S extends P {
static{
System.out.println("S is init");
}
}
public class Test {
public static void main(String[] args) {
System.out.println(S.abc);
}
}P is init<br />123
不会初始化子类的几种
1. 调用的是父类的static方法或者字段
2.调用的是父类的final方法或者字段
3. 通过数组来引用
边栏推荐
猜你喜欢
随机推荐
MySQL environment variable configuration tutorial
100% understanding of 5 IO models
MySQL索引详解
05 observer mode
Filter filter
浏览器的markdown插件显示不了图片
Preliminary understanding of C #
Futures reverse Documentary - training for traders
盲测调查显示女码农比男码农更优秀
Rough reading DS transunet: dual swing transformer u-net for medical image segmentation
lvgl使用demo及说明2
(note) Anaconda navigator flashback solution
参考 | 升级 Win11 移动热点开不了或者开了连不上
05 观察者(Observer)模式
Read datasets iteratively with xgboost
2022 love analysis · panoramic report of it operation and maintenance manufacturers
MySQL lock details
Experience record of Luogu's topic brushing
【11. 二维差分】
[batch dos-cmd command - summary and summary] - parameters%0,%1,%2,%[0-9],%0-9 in the batch command and batch command parameter position switching command shift, operator% usage in the DOS command









