How to implement boxing and unboxing in my own class?

前端 未结 3 837
时光说笑
时光说笑 2021-01-18 21:23

In Java there is no operator overriding like i C++ so I can\'t figure out how to implement a boxing/unboxing for my own class.

For example it\'s possibile to use box

3条回答
  •  自闭症患者
    2021-01-18 22:08

    It's not possible to implement automatic boxing and unboxing for your own class - auto(un)boxing is a language feature, implemented in the Java compiler.

提交回复
热议问题