File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes separator of the File Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "separator of the File Class" Watch "separator of the File Class" New topic
Author

separator of the File Class

natarajan meghanathan
Ranch Hand

Joined: Feb 01, 2001
Posts: 130
Following is a question from JQ+
Which of these statements about the constant named 'separator' of the File class are true?
1. It is of type char.
2. It is of type String.
3. It takes a value of '\' in Windows and '/' in Unix.
4. It is always of 1 char.
5. It can be of more than 1 character.
I went for 2,3,5.
But the correct answer is 2,3,4.
In KAM, in the Review Questions he validates the option e) in Q18.2 saying that The separator can consist of more than one character.
Since i could work on Windows or unix only, i couldn't try with other OS.
Can any one help me.
TIA

Sun Certified Programmer for Java 2 Platform
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
1. It is of type char.
2. It is of type String.
3. It takes a value of '\' in Windows and '/' in Unix.
4. It is always of 1 char.
5. It can be of more than 1 character.
One is in correct it expects a String , 3 you already know and i don't think that other systems have more then one character representing a file separator.


Val SCJP <BR>going for SCJD
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3285
    
    7
The given answer is correct. You might want to confirm the answer using the API.
HTH,
Paul.
------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: separator of the File Class