In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "how to assign values to arrays in java", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to assign values to arrays in java" article.
1. First of all, after we choose to create a new java project in the development tool, declare a string array in the newly created .java, as follows:
Public class ArrayMath {public static void main (String [] args) {String [] s = new String [6]; / / define string group}}
If you want to declare an array of other types, we just need to change the String in the code block String [] s = new String [6] to another type. Let's take a look at how to write the int array. The code is as follows:
Public class ArrayMath {public static void main (String [] args) {int [] i=new int [6]; / / define an integer array}}
two。 So when we know how to declare a value, we further assign a value to our array, as follows:
Public class ArrayMath {public static void main (String [] args) {String [] s = new String [6]; / define the string group int [] i=new int [6]; / / define an array of integers String [] str2= {"a", "b", "c"}; int [] i=new int [] {0jue 1m 2pm 3} }} the above is about the content of this article on "how to assign values to arrays in java". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please 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.