Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java.util.Locale will accept any String... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java.util.Locale will accept any String..." Watch "java.util.Locale will accept any String..." New topic
Author

java.util.Locale will accept any String...

Chandella Montero
Ranch Hand

Joined: Feb 18, 2011
Posts: 89
and will compile and run! Watch out for this one on the exam:



The output is:

heaven

Process completed.


OCA, OCP Java 6
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Is that an observation or a question?
Chandella Montero
Ranch Hand

Joined: Feb 18, 2011
Posts: 89
It was an observation. I don't really know why, but just realised that it happens, so it's something to watch out for.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.util.Locale will accept any String...
 
Similar Threads
ResourceBundle not using Locale
Getting locale/language in struts beans
Struts2 Internationalization
is it possible to change jvm locale by using command line parameters ?
Calendar with Locale