This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
i am having some doubts in the following cp..
1) -cp /dirB:/dirA/dirB/dirC
here the directories are searched from root as the / indicates..
my question is what directories will be searched if the current directory is dirA?
the answer given in book is only dirC but how??directory B will also be searched when DirA is treated as current directory
2)"It doesn't matter what the current directory is; since absolute paths are specified the search results will always be the same." im unable to understand the meaning of this line
to understand this you need to understand the concept of Absoute Path and Relative path. Absolute path starts from the root of the file system. if the file system is Unix/Linux , it is the root folder which is represents as single forward slash /. in case of windows based system root of the file system will be root drive for eg. c:\ or D:\. Relative path means "relative" to the current working directory. in your example the classpath is given as /dirB:/dirA/dirB/dirC. since the path starts from / it is absolute path. now if you consider the directory structure given in book , it says that root folder(/) contains dirA, which contains dirB, which further contains dirC. so /dirB means that "a directory by the name dirB in root folder (/) " which obviously is not there. then it will look at /dirA/dirB/dirC, which means starting from root folder, then dirA, inside dirA there should be dirB and then dirC. so it will look for classes in dirC.
second part of your question is also summed up in the above paragraph. since the paths are absolute, no matter in which directory you are , you will always start from the root directory(/). so current working directory doesn't matter.