• 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

JQ+: I/O QUESTION

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

JQ+: QID:953742713310
The said question in JQ+ states that separator of the File class is always composed of 1 char.
While same question, with the same options have been asked in Khalid Mughals' (p 565:Q 18.2) stating that File Separator may be one or more than one character, and there is no such restriction.
I am bit confused which one is right.

Secondly, I just started JQplus, and I found atleast in IO section, JQplus questions and khalid's book questions have a striking resemblance. lot many questions , it appears , have been copied from Khalid's book. Q18.10 , 18.18 Khalid's book, has been copied word to word.
Other Questions like Q 18.15 , 18.14 etal of Khalid's book have all been simply rephrased.

If that be the case, I think JQ+ is not worthwhile, for those who already have done Khalid's book.
Moreover, with most of these questions, it has been written that
"A very similar question has been asked in SCJP2". Now what does this mean. The Question is 18.15, 18.18 etal from Khalids book, is appearing in JQ+, and has been added to it is that a similar question has been asked in SCJP2.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Zeeshan,
After consulting the API docs and reading the exact sentences that are written there, I have to agree with KM and not JQ+.
While it is true that currently all supported systems only use a single character the String variable separator doesn't restrict it to that. The file class has a separatorChar variable inside it and its' API doc states:


The system-dependent default name-separator character. This field is initialized to contain the first character of the value of the system property file.separator.


The bold part is what led me to believe KM.
Regards,
Manfred.
 
Enthuware Software Support
Posts: 4841
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The API clearly states:
public static final String separator
The system-dependent default name-separator character, represented as a string for convenience. This string contains a single character, namely separatorChar.
Where is the room for confusion?
-Paul.

------------------
Get Certified, Guaranteed!
www.enthuware.com/jqplus

SCJP2 Resources, WebCompiler, Compare Mock Exam Results and More!
www.jdiscuss.com
Your guide to SCJD exam!
www.enthuware.com/jdevplus
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,
The API doc also clearly states my quote above ...
Regards,
Manfred.
 
Paul Anilprem
Enthuware Software Support
Posts: 4841
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But your quote is not inconsistant with the other quote!!!
Your quote states that separatorChar is initialized to contain the first character of the value of the system property file.separator. That means it does contain just one char. (Of course, it is of type char)
The second quote is talking about the separator. That it merely contains what separatorChar contains. So it also contains just one char.
Where is the problem???
[This message has been edited by Paul Anil (edited June 13, 2001).]
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
regarding similarity between jqplus and khalid mughal
majority of the questions in jqplus are from khalid mughal
if u have khalid mughal's book then jqplus is not worth buying
most of the questions have been copied word to word from khalid mughal
 
ZEESHAN AZIZ
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thus can I conclude, that for the purpose of exam, File.Separator is composed of one char.
By the way, I checked Khalid's errata ,and is this point is not mentioned there.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic