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 File Object, Poddar Exam Q: 41 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "File Object, Poddar Exam Q: 41" Watch "File Object, Poddar Exam Q: 41" New topic
Author

File Object, Poddar Exam Q: 41

zulfiqar raza
Ranch Hand

Joined: Oct 18, 2000
Posts: 81
In the following question:
Q41) What will be the output
Consider a directory structure like this (NT or 95)
C:\JAVA\12345.msg --FILE

The answer given is : d
d) \12345.msg
\
true
12345.msg
false
false
Shouldn't the isAbsolute method return false for Win 95, NT. That is what happens on my Win 98 machine with Java 2, sdk 1.3.
thanks,
Zulfiqar
PS: I edited it to format the code.
[This message has been edited by zulfiqar raza (edited October 19, 2000).]
[This message has been edited by zulfiqar raza (edited October 19, 2000).]
lakshmi nair
Ranch Hand

Joined: Oct 11, 2000
Posts: 63
But i get it as
\12345.msg
\
false
12345.msg
false
false
Mine is JDK1.2 running on Win98
Lakshmi
zulfiqar raza
Ranch Hand

Joined: Oct 18, 2000
Posts: 81
Yes, I get the same result. Like I stated the return value from isAbsolute() is false. So is the answer given incorrect?
I did look it up from Mughal/Rasmussen. It says that on Windows a path is absolute if the first character is \ or a drive letter precedes it e.g., C:\
In this case the first could be true. But the SDK return false.
Can anyone clarify?
thank you,
Zulfiqar.
 
 
subject: File Object, Poddar Exam Q: 41
 
Threads others viewed
IO question
getPath()
"has a " relationship
i/o
doubt in File methods
MyEclipse, The Clear Choice