当前位置:网站首页>Abstract classes and interfaces
Abstract classes and interfaces
2022-07-29 06:17:00 【Plum juice】
Go back again static
Static method calls You can direct the method name ();
The call of non static methods should new An instance of an object . call
Static is executed only once
final
final Modification constant value cannot be modified for the second time
*final Prevent instruction reordering under multithreading , Ensure thread safety
final Decorated classes cannot be inherited
final The decorated method cannot be overridden
abstract class abstract
Methods of abstract classes must be implemented by subclasses
You can't abstract classes new Can only be implemented by subclasses
Abstract methods must be in abstract classes
reflection Do abstract classes have constructors What is the meaning of being
There are constructors Used for subclass instantiation
Interface
All definitions of interfaces are abstract public abstract keyword interface
Interfaces must implement classes keyword implements yes Implementation interface
The interface supports multiple implementations
Interface cannot be instantiated There is no constructor in the interface
Can not be new But you can cooperate An anonymous class
Inner class
1. Member inner class
public class Outer {
private int id;
public void out(){
External class methods
}
class Intter{
public void in(){
Inner class methods
}
}
}2. Static inner class
public class Outer {
private int id;
public void out(){
External class methods
}
public static class Intter{
public void in(){
Inner class methods
}
}
}3. Local inner classes
public class Outer {
public void method(){
class Inner{
}
}
}4. Anonymous inner class
public class Test {
public static void main(String[] args) {
new Apple().eat();
}
static class Apple{
public void eat(){
System.out.println(“1”);
}
}
}
边栏推荐
- 扬尘噪声监控系统
- 倾角传感器用于通信铁塔、高压电塔长期监测
- 唯美girls
- 物联网倾斜监测解决方案
- Jingwei Qili: development of heart rate and blood oxygen module based on hmep060 (1: FPGA sends multi bit instructions)
- 从头安装MYSQL(MYSQL安装文档-解压版)
- 2022 spring recruit - Shanghai an road FPGA post Manager (and Lexin SOC interview)
- 【软件工程之美 - 专栏笔记】13 | 白天开会,加班写代码的节奏怎么破?
- 【RoboMaster】从零开始控制RM电机(2)-CAN通信原理及电调通信协议
- From entry to soul: how to use tb6600 single chip microcomputer to control stepping motor with high precision (42/57)
猜你喜欢

SimpleFOC调参1-力矩控制

基于51单片机的四路抢答器仿真

新能源共享充电桩管理运营平台

shell工具finalShell

2022 spring move - core technology FPGA post technical aspects (one side experience)

ML7 self study notes

markdown与Typora

给二维表添加时间序列索引

FPGA based: moving target detection (schematic + source code + hardware selection, available)

2022暑初二信息竞赛学习成果分享2
随机推荐
clickhouse 导入CSV失败 不报错但是无数据
Huawei cloud 14 day Hongmeng device development -day2 compilation framework
兼容cc1101/cmt2300-DP4301 SUB-1G 无线收发芯片
Hal library learning notes-13 application of I2C and SPI
【软件工程之美 - 专栏笔记】16 | 怎样才能写好项目文档?
八大排序----------------冒泡排序
基于DAC0832的直流电机控制系统
STM32 检测信号频率
scanBasePackages扫包范围配置
【RoboMaster】从零开始控制RM电机(2)-CAN通信原理及电调通信协议
传统模型预测控制轨迹跟踪——圆形轨迹(功能包已经更新)
SimpleFOC+PlatformIO踩坑之路
抽象封装继承多态
基于msp430f2491的proteus仿真(实现流水灯)
mavan中的plugin位置
【软件工程之美 - 专栏笔记】24 | 技术债务:是继续修修补补凑合着用,还是推翻重来?
倾角传感器精度校准检测
顺序表和链表
智能温度控制系统
STM32: mcnamu wheel tracking task (library function program code)