0

What else "new" used to define except array's capacity- number of elements in array?

What "new" used for?

16th Sep 2019, 2:04 PM
Anna Shepilova
Anna Shepilova - avatar
2 Answers
+ 3
"new" is used to create objects. String[] x = new String[10]; Here I am creating 10 String refrenece variables that can store a String value. You access each one like so... x[0] = "Hello"; x[1] = "World";
16th Sep 2019, 2:08 PM
D_Stark
D_Stark - avatar
+ 2
Thank you! Great!
16th Sep 2019, 2:18 PM
Anna Shepilova
Anna Shepilova - avatar