当前位置:网站首页>Spuer and this keywords
Spuer and this keywords
2022-07-20 17:42:00 【@@Laohu】
Simply speaking ,spuer Is the method or property of the parent class ,this Is the method or attribute of the current class
- First, paste the code , this father and sun There is one. name attribute ,test It will instantiate sun One of the test Method
package javatest.supertest;
public class FatherTest {
protected String name="father";
public void print(){
System.out.println("This is father");
}
}
package javatest.supertest;
public class SunTest extends FatherTest {
private String name="sun";
public void print(){
System.out.println("This is sun");
}
public void test(String name){
System.out.println(name);// What's generated here is test Incoming parameters
System.out.println(this.name);// What's generated here is SunTest The built-in name attribute
System.out.println(super.name);// Here is a generated FatherTest Of name attribute
}
}
```java
package javatest.supertest;
public class Test {
public static void main(String[] args) {
SunTest sunTest=new SunTest();
sunTest.test("Test");
}
}
- The output here is obvious
边栏推荐
- D1-从零理解神经网络
- 携手紫光展锐,与德通讯借道与展微电子杀入物联网芯片市场
- Wechat authorized login
- Opensmax: unknown domain generation algorithm detection ecai2020 open set identification paper interpretation
- 2021-07-06 力扣每日一题
- A Comparative Analysis of Deep Learning Approaches for Network Intrusion Detection Systems (N-IDSs)
- Multithreading - thread pool usage
- Distance-Based Background Class Regularization for Open-Set Recognition
- idea读取配置文件如ValidationMessages.properties中文乱码
- Devops failed!
猜你喜欢
XML file fuzzy query writing method SQL function find_ in_ set
OPEN-SET RECOGNITION WITH GRADIENT-BASED REPRESENTATIONS
青花瓷Charles使用
OCR系列训练记(一)
Rstudio显示连不上网页了,或者换新网址了。
大华海康摄像头视频拉流
Opensmax: unknown domain generation algorithm detection ecai2020 open set identification paper interpretation
【UE4】复杂背景人像抠图-飞浆AI-paddlepaddle深度训练模型
序列化和反序列化
可以 DIY 装修的商城系统,你也能拥有!
随机推荐
PS高效修图
Get the return value of get request
DWB layer of data warehouse, 220620, HM,
基于Jsp+Servlet+MySQL+Bootstrap简单的学生信息管理系统
lc marathon 7.19
MobileNet,从V1到V3
浏览器的事件循环(Event Loop)
Paper reading - temporary fusion transformers for interpretable multi horizon time series forecasting
Deep open intent classification with adaptive decision boundary aaai2021 interpretation of open set identification papers
R语言报错
miRNA几大常用的数据库
Masktextspotterv3 testing and training
LambdaQueryWrapper、LambdaUpdateWrapper、LambdaQueryChainWrapper的使用
OPEN-SET RECOGNITION WITH GRADIENT-BASED REPRESENTATIONS
Talk about OPS (summary + final): tools and Practice
XML file fuzzy query writing method SQL function find_ in_ set
申万宏源手机开户流程是怎样的,手机开户安全吗
训练自己的实例分割模型
华为5G欧洲遇阻,又一国家宣布考虑禁用!
celery 基本使用