https://ciang.top/ https://ciang.top/
首页
  • 首页
  • python
  • 工具经验
  • 教程
  • c++
  • mysql
  • 登录
搜索历史 清空
写文章

登录

账号密码登录
扫码登录
扫码登录
请使用手机扫码登录
注册登录即表示同意用户协议和隐私政策
编程
思路/心得
传奇私服-V8M2引擎学习笔记
教程
翻译
游戏
java c/c++ mysql python excel html/css/js 工具经验
推荐 最新
C++类的虚函数继承 && Java类的方法重写
benojan 2025-3-24

C++类的虚函数继承 && Java类的方法重写

C++的虚函数virtual #include <iostream> using namespace std; class Father { public: virtual void hello() { cout << "father"; } }; class Son : public Father { public: void hello() { cout << "son"; } }; int main() { Father* f = new Son(); // 如果Father类不写virtual,则结果为father f->hello(); // son } Java的类方法重写 public class Father { public void hello() { System.out.println("father"); } } public class Son { public void hello() { System.out.println("son"); } } import java.util.ArrayList; public class Main { public static void main(String[] args) { Father f = new Son(); f.hello() // son } }

204 27 0
虚函数继承重写

搜索

搜索历史 清空

最新评论

标签

  • 重写
  • 继承
  • 虚函数
  • springboot
  • java
  • drf
  • 私服
  • 脚本
  • Windows窗口程序
  • cmake
  • dll
  • Modeless
  • Accelerators
  • WTL
  • ListCtrl
  • MFC
  • regex
  • 正则表达式
  • 虚拟环境
  • venv
  • radio
  • html
  • vim
  • nodejs
  • Linux
  • 宝塔面板
  • bt
  • chatGPT
  • AI
  • turtle
  • python
  • 我的世界
  • api
  • bukkit
  • 字符串操作
  • docker
  • 本地架设
  • 游戏
  • 编程
  • CodeCombat
  • 教程
  • 插件开发
  • Minecraft
  • GBK
  • Unicode
  • UTF-8
  • 字符集
  • 转换
  • 编码
  • boost

链接

  • 標準吳語字典
  • 台州方言維基
  • 溫嶺吳語微辭典
关于 友链 rss
Powered by benojan

备案号: