博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++类默认的成员函数与Java Object类中的成员函数
阅读量:4097 次
发布时间:2019-05-25

本文共 1540 字,大约阅读时间需要 5 分钟。

这两个问题虽然不太难,纯属记忆问题,但是在面试的时候还是很容易被问到的,再强调一次,面试还是很容易问到的……面试题目……

C++空类默认成员函数

class EmptyCppClass{  public:      EmptyCppClass(); // 缺省构造函数      EmptyCppClass( const EmptyCppClass& ); // 拷贝构造函数      ~EmptyCppClass(); // 析构函数      EmptyCppClass& operator=( const EmptyCppClass& ); // 赋值运算符      EmptyCppClass* operator&(); // 取址运算符      const EmptyCppClass* operator&() const; // 取址运算符 const};

Java Object类默认成员函数

public class Object{
private static native void registerNatives(); static { registerNatives(); } public native int hashCode(); public boolean equals(Object obj) { return (this == obj); } protected native Object clone() throws CloneNotSupportedException; public String toString() { return getClass().getName() + "@" + Integer.toHexString(hashCode()); } public final native void notify(); public final native void notifyAll(); public final native void wait(long timeout) throws InterruptedException; public final void wait(long timeout, int nanos) throws InterruptedException { if (timeout < 0) { throw new IllegalArgumentException("timeout value is negative"); } if (nanos < 0 || nanos > 999999) { throw new IllegalArgumentException( "nanosecond timeout value out of range"); } if (nanos > 0) { timeout++; } wait(timeout); } public final void wait() throws InterruptedException { wait(0); } protected void finalize() throws Throwable { }}

转载地址:http://ogqii.baihongyu.com/

你可能感兴趣的文章
VS编译器运行后闪退,处理方法
查看>>
用div+css做下拉菜单,当鼠标移向2级菜单时,为什么1级菜单的a:hover背景色就不管用了?
查看>>
idea 有时提示找不到类或者符号
查看>>
JS遍历的多种方式
查看>>
ng-class的几种用法
查看>>
node入门demo-Ajax让前端angularjs/jquery与后台node.js交互,技术支持:mysql+html+angularjs/jquery
查看>>
神经网络--单层感知器
查看>>
注册表修改DOS的编码页为utf-8
查看>>
matplotlib.pyplot.plot()参数详解
查看>>
拉格朗日对偶问题详解
查看>>
MFC矩阵运算
查看>>
最小二乘法拟合:原理,python源码,C++源码
查看>>
ubuntu 安装mysql
查看>>
Win32编程绘图实例--字母图
查看>>
c# 计算器
查看>>
C# 简单的矩阵运算
查看>>
gcc 常用选项详解
查看>>
c++输入文件流ifstream用法详解
查看>>
c++输出文件流ofstream用法详解
查看>>
字符编码:ASCII,Unicode 和 UTF-8
查看>>