Mohit Acharya

Greenhorn
+ Follow
since Aug 04, 2019
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mohit Acharya

Hi Jeanne,

That does make sense. No i see what the question was trying to make me understand.

Appreciate your quick response.
BTW, do you have a list of all the erratas that have been submitted for this book ? i was thinking it would be in the Sybex website (https://testbanks.wiley.com) but i'm not able to find it there.

Thanks once again.
Mohit
Hi Jeanne,

Thanks for the quick reply, and i'm sorry i did not post the question properly the first time. I'm attaching the answer pictures in this thread.

You are correct, that D : The code will not compile because of line 2 was never the answer because the code compiles without any issue. My only question was regarding C : It can delete a single file. While it can delete a single file, the code can also recursively clean the entire directory as well. That's where the answer C (It can delete a single file ) confused me.

So while i think that C is correct, I want to make sure that i'm reading the code snippet correctly when i'm saying that it's able to also recursively delete "ALL" the files in the directory as well. In other words, i fail to see how the code snippet could only delete only a single file in the directory.

My apologies for the confusion once again.

Thanks
Mohit
Hi All,

Book : Oracle Certified Professional Java SE8 Programmer 2 (IZO-809)

I have a question regarding Chapter 8(IO): Question 10  (pg 447).

 


A. It can delete a directory that contains only files
B. It can delete a directory tree of arbitrary length
C. It can delete a single file. -
D. It compiles but may throw an exception at runtime

The book says that C and D are correct answer but from what the code is doing, it looks like it's able to delete recursively all the files. So to me, looks like the code can delete a directory tree of any arbitrary lenght, it's just that it can't delete the directory itself.

Am I failing to understand something ?