How to initialize array in java?

DWQA QuestionsCategory: QuestionsHow to initialize array in java?
Editor Staff asked 2 months ago

How to initialize array in java?

1 Answers
Editor Staff answered 2 months ago

“int[] arr = new int[5]; // integer array of size 5 you can also change data type
String[] cars = {“”Volvo””, “”BMW””, “”Ford””, “”Mazda””};”