• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

relative &absolute

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between realtive and absolute path.
Can anyone explain it with examples?
Waht do you mean by Top level nested class
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Absolute Path: c:\temp\data
Relative Path: ..\..\newDir\oldDir
Top level nested class --> static inner class
Top level because we don't need an instance of outer
nested because it is defined inside another class
Regards,
Manfred.
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Relative means that the path you will supply is 'relative' to the current working directory whereas absolute means to just follow the path absolutely starting at the systems/context/root directory.
If I am running my application in c:\myapps\javaApps\testStuff\ and I specify...
../../images/Relative.jgp
This will go into c:\myapps\images and look for Relative.jpg file becuse the ../ means backup a directory. the path is in relation to the current working directory.
If I put...
/oldFiles/OldClass.java
Then I will look in c:\myapps\javaApps\testStuff\oldFiles for the file OldClass.java because the path is 'relative' to the current one so it goes into the oldFiles subdirectory. Again the path is in relation to my current one.
If I do..
C:\anotherPlace\images\Absolute.jgp I will go absolutely into that directory. It has nothing to do with my working directory.
There are times when the "current" directory will be harder to determine like with web paths (they may have diffrent default or root directories, but these you will have to read up on.
Hope this helps.
 
shabbir zakir
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot.
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic