Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Q46 - Mock Exam - OCP7 by Mala Gupta

 
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q46. Given:


The output is said to be:
b)
Mr Selvan
Ms Shreya
Dr Shreya

Isn't it supposed to be:
a)
Mr Selvan
Dr Shreya
Ms Shreya

Since it's supposed to be sorted alphabetically? Is it a possible errata or am I missing something?

Thank you in advance!

 
Yin Stadfield
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooops. I think I got it after rereading the explanation in the book. It's because title is an enum, and enums are sorted on the order of their declaration.
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic