answer : D
A canonical pathname is both absolute and unique. That means it includes getting absolute path and no removing redundant names (normalization).
ABC doesn't include both those operations. D includes it with file.getCanonicalPath();
D is correct
The file object is created using the filename variable.The getCanonicalPath() method is called on the file object to get the canonical path of the file.The canonicalPath variable is then used to create a new FileInputStream object.
This code will ensure that the path name is validated and canonicalized before the file is read.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
5 months, 1 week agod7bb0b2
6 months, 3 weeks agoAshan_Ozlov
10 months, 1 week agoStavok
1 year agoKiraguJohn
1 year ago