In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of how to use the java self-increasing and self-subtracting operators, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this article on how to use the java self-increasing and self-subtracting operators. Let's take a look.
1. Nasty + adds the current value of the variable n by 1 and subtracts the value of the variable n by 1.
2. These operators change the value of the variable and cannot be applied to the numerical value itself.
3. In the expression, n means self-increment and then assignment, and n means assignment and then self-increment.
Example
/ / mixed with print operation, int num2 = 20 impact / mixed, first + +, the variable immediately becomes 21, and then print the result 21System.out.println (+ + num2); / / 21System.out.println (num2); / / 21System.out.println ("="); int num3=30;// mixed use, followed by + +, first use the original 30 of the variable, and then let the variable + 1 get 31System.out.println (num3++); / / 30System.out.println (num3) / / 31System.out.println ("="); int num4 = 40 num4 / mixed with assignment operation int result1 =-- num4;//, the former--, immediately-1 becomes 39, and then the result 39 is handed over to the result1 variable System.out.println (result1); / / 39System.out.println (num4); / / 39System.out.println ("="); int num5 = 50 / / mixed use, after-- first give the original number 50 to result2, and then I change-1 to 49int result2 = num5--;System.out.println (result2); / / 50System.out.println (num5); / / 49System.out.println ("="); int x = 10X int y = 20bot result3 11mm 20mm 31int result3 = + + x + y Mustang system. Out.println (result3); / / 31System.out.println (x); / / 11System.out.println (y) / / 19Universe / wrong spelling / 19 / 19 / 19 / 19 / 19. Constants cannot use + + or--} this article on "how to use the java self-increment and self-subtraction operators" ends here, thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use java self-increasing and self-decreasing operators". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.