In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to use the java self-increment and self-subtraction operators". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use the java self-increasing and self-subtracting operators.
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--} so far, I believe you have a better understanding of "how to use the java self-increment and self-subtraction operator". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.