• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

mock question response right?

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi everyone,

In a mock exam I found a question which response annoys me:

Which is true about printing a Calendar date in different formats using different locales?



And the exam marks this answer as right:

You could use DateFormat.format() method.

With that syntax I understand that format() is a static method. And there is not such static format() method in DateFormat class. Therefore I wouldn't consider it a right choice.

Maybe I'm totally wrong, but I would find it unfair to have that question marked as wrong because of that.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its true that DateFormat does not have any static method called format, but the class has been extended from Format class, which does have a static method called format.

I hope you should now be able to get why the answer has been marked correct.

Please correct me if I am wrong.
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My documentation doesn't have any static format method in the Format or DateFormat class. Which mock exam are you talking about??
 
Alex Serna
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's true DateFormat inherits format() from Format class, but still, format() in Format class isn't Static. I'm talking about the practice exam that comes with the K & B book. It's question number 29.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic