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.
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.
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.
Hi Paul, The API doc also clearly states my quote above ... Regards, Manfred.
Enthuware Software Support
Joined: Sep 23, 2000
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).]
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
Joined: Jan 15, 2001
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.