For example this array has 5 element.
int saffet[] = {0,2,4,6,8};
And this has 2
int saffet[] = {0,2};
How can i get such as above?
(question is maybe simple because I’m learning java new)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yup, it’s easy 🙂
Note that it’s recommended that you keep the type information together when declaring a variable (or parameter, return type etc) – while your declaration is correct, this is preferred:
See chapter 10 of the Java Language Specification for more details on arrays.