Java Array newInstance() MethodLast Updated : 17 Mar 2025 The getInstance() method of Array class is used to create a new array with the specified component type and dimensions. If componentType is a class of type non-array or interface, the new array has dimensions.length dimensions and componentType as its component type. SyntaxParametercomponentType - the object representing the component type of the new array dimensions - an array of int representing the dimensions of the new array Returnsthe new array ThrowsNullPointerException IllegalArgumentException ArrayIndexOutOfBoundsException - NegativeArraySizeException Example 1Output: Array[0][0] = javaTpoint Array[1][1] = .Net Array[2][2] = c# Example 2Output: [0, 1, 2, 3] Next TopicJava Array Class |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India