• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic