write a java statement to create an array named search of size 30
Share
write a java statement to create an array named search of size 30
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.
Answer:
For example, an array named myarray can be initialized with integers 10, 20 and 30 by three methods.
Method 1. int[] myarray = new int[]{10, 20, 30};
Method 2. int[] myarray = {10, 20, 30};
Method 3. int[] myarray = new int[3]; myarray[0] = 10; myarray[1] = 20; myarray[2] = 30;