Java Magazine, Jan/Feb 2018
ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2018 113 fix this for the expression and it doesnt really matter if it chooses Object or CharSequence Either is a legitimate argument to the println method and consequently the code compiles successfully Of course the expression sb equals s still evaluates to false and the output that is printed is Differ as it was in option D Therefore option E is correct As a side note the CharSequence interface isnt explicitly mentioned in the exam objectives However both String and StringBuilder are and this interface is an aspect of both We doubt youll come across it in the real exam but our excuse is that by using it here we were able to make the example a little more interesting and perhaps teach something useful We hope youll forgive the indulgence article Simon Roberts joined Sun Microsystems in time to teach Suns first Java classes in the UK He created the Sun Certified Java Programmer and Sun Certified Java Developer exams He wrote several Java certification guides and is currently a freelance educator who publishes recorded and live video training through Pearson InformIT available direct and through the OReilly Safari Books Online service He remains involved with Oracles Java certification projects Mikalai Zaikin is a lead Java developer at IBA IT Park in Minsk Belarus During his career he has helped Oracle with development of the Java certification exams and he has been a technical reviewer of several Java certification books including three editions of the famous Sun Certified Programmer for Java study guides by Kathy Sierra and Bert Bates
You must have JavaScript enabled to view digital editions.