In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use constants in the basis of Java". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use constants in Java Foundation".
/ * the constants in java are divided into the following categories 1. Integer constant 2. Floating point constant 3. Character constant 4. Boolean constant 5. String constant * / public class FinalVariable {public static void main (String [] args) {/ / constant definition: immutable variable / / 1. Integer constant final int UP=0; final int DOWN=1; final int LEFT=2; final int RIGHT=3; System.out.println (UP); System.out.println (DOWN); System.out.println (LEFT); System.out.println (RIGHT) / * Note: 1. Constants are generally defined in uppercase * / 2. Floating point constant final float PI=3.14f; System.out.println (PI); / / 3. Boolean constant final boolean RUN=true; System.out.println (RUN); / / 4. Final char constant character constants: System.out.println (A); System.out.println ('\ r'); System.out.println ('\'); System.out.println ('\ "); System.out.println ('\'); / / 5. String constant final String CONST= "everlasting love"; System.out.println (CONST);}} / * Summary: 1. The naming rules of constants are the same as variables. Constants are generally capitalized 3. The constant is preceded by the final keyword 4. Constants cannot be changed * / the above is all the content of the article "how to use constants in Java Foundation". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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: 217
*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.