gpt4 book ai didi

java - 将 C++ 类转换为等效的 Java 类

转载 作者:太空宇宙 更新时间:2023-11-03 10:21:18 25 4
gpt4 key购买 nike

假设我在 C++ 中有一个构造函数:

public class Machine { 
public:
Machine(int boltCount, bool failure=false);
};

如何将其转换为 Java 中的等效类?

谢谢,

最佳答案

类似的东西

public class Machine { 
public Machine(int boltCount) { this(boltCount, false); }
public Machine(int boltCount, bool failure) { /*body here*/ }
};

关于java - 将 C++ 类转换为等效的 Java 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4138236/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com