• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

JavaScript?????

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was searching for information on arrays, which I thought could not be expanded once created. However, I found an article on "javascript" that talked about "growing" an array. Can the size of arrays be modified, and what is the difference between Java and JavaScript?
Thanks,
Landon
 
author and iconoclast
Posts: 24208
47
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is absolutely no connection between Java and JavaScript other than the name (JavaScript was called "LiveScript" up until the last minute before it was first release; the name was some marketing dude's idea.) JavaScript is a more or less object-oriented language, like Java, and the syntax is vaguely similar, but that's where the relationship ends.
You can "grow" a Java array using the Texas 3-step:
  • Allocate a new bigger array
  • Copy the old array's contents into it using System.arraycopy()
  • Assign the variable through which you accessed the old array to point to the new one.

  •  
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic