Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kristopher Davis   on Aug 02 In Java Category.

  
Question Answered By: Angel Watkins   on Aug 02

the answers are:

1) Arrays in Java _can_ be assigned with a fixed size, but
nevertheless you can add as many new elements to them as you like to.
The only trouble you're causing this way (despite that it's a very
poor design if you do so, if you need a dynamic array  use the
ArrayList instead of an array) is that the built-in memory management
of Java has lots of unnecessary work to do; this slows down your
application considerably. But despite that there's no problem with
using an array and adding loads of new elements.
2) If you enter C:\*.* or something else that contains a
metacharacter like '*' or '?' (and all the other metacharacters used
by the various Unix shells), then the shell expands these strings
containing metacharacters to a list of all fitting file names, and
then this list of file names is passed to your Java class as
arguments to main(). Even the cmd.exe in Windows sometimes does this.
That's one reason why file names are usually enclosed in double
quotes "": to make sure that these strings are passed without file
name expansion to the respective program.

Everything clear  by now? If not, please ask again.

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on query for Java Exports Or get search suggestion and latest updates.


Tagged: