• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

setting Property values twice

 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In K & B chap 10 ,9Ques of self test exam ,at pg 795,
It regarding
if we seeting some ,same property with different values,
1 programmitcally ,and 1 on command line ,which takes priority.

answer is command line.
but when i try running ,it works opposite.
please let me know ,what is exact thing.
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a test, and I am afraid that it shows that your books is right.

I am running this program with the following command line:



The program contains the following code:



The word "sue�o" is the Spanish word for "dream". It uses the "�" character, which is not part of the ASCII, but it is part of UTF-8.

If I run this program it prints:



Which means that although I changed the setting of the file encoding to UTF-8, by the time my program manipulated this String, it still did it with ASCII encoding.

Therefore, the setting from the command line prevailed over the one provided programatically. Just as your book said.
[ September 26, 2007: Message edited by: Edwin Dalorzo ]
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
answer is command line.
It work's fine for me .
 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yaa
i got the answer.i was mis-writing the program.
with setPropety() and command line ,setProperty() works.
but with getPrioeirty(key,defValue) which sets only inital-default value,
command line parameter overrides it
thank you much
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic