Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array constructor

 
Kirill Yunussov
Greenhorn
Posts: 2
Chrome Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Exactly what code runs when you initialize an array as follows? I tried to see in debug but it doesn't go into the array's constructor. Just curious what it looks like.






 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Arrays are a built-in feature of Java. There's really no code to jump into - in fact, there's a single bytecode instruction for creating an array (the bytecode instruction "anewarray").

There is no constructor for arrays.
 
Kirill Yunussov
Greenhorn
Posts: 2
Chrome Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
great, thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic