Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Experience the convenience of finding accurate answers to your questions from knowledgeable professionals on our platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.
Sagot :
Answer:
Following are the code to the given question:
public class Main//defining class Main
{
public static void main(String[] abv)//defining main method
{
int nums[]={11,36,31,-2,11,-6};//defining an integer array nums
System.out.print("{");//print bracket
for(int i=0;i<nums.length;i++)//defining for loop to print value
{
System.out.print(nums[i]+",");//print array values
}
System.out.print("}");//print bracket
}
}
Output:
{11,36,31,-2,11,-6,}
Explanation:
In this code, a class Arr is declared that uses the main method, and inside the main method, an integer array nums are declared, which initializes the integer values and uses the for loop to print the initialized values with the curly bracket to prints value between them.
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.