Integer n = 5; System.out.println(n) // 5!
How can I reproduce this behavior in my classes?
You can not. This is called Autoboxing, and this feature of some classes in Java makes it easier to work with classes that represent primitive type types int.
Autoboxing
int
Depending on what kind of behavior you want, you either cannot, or you need to implement the toString () method to get print (ln) to print a text representation of your object.
Java.
You cannot overload operators in Java. The Sun guys decided that they would do it for several classes, but they won’t let you do it yourself.
The assignment operator cannot be overloaded in java. You need to look at other languages like C ++. I do not know if you can do this even there for an assignment operator.
Source: https://habr.com/ru/post/1729738/More articles:How to make a pop-up window to ask the user about the expanded resolution in the i-frame application - facebookHow to write text on texture using java3D API? - javaWorld clock with DST support and server synchronization - javascriptDBus Glib Send Signal - Сигналы, которые не выбрасываются - cGMP converts mpz to mpf - cUnit Testing Jade - javatransition to open source solutions - linuxCounting sorting in java for tuples - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1729742/how-to-development-in-visual-studio-and-then-deploy-apps-to-linux-machine-os-ubuntu-web-server-nginx&usg=ALkJrhixBpLiQpfFn2xTjSk-2xDflAB6ZQWhat is the advantage of themes over CSS in ASP.NET? - cssAll Articles