File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes wanna know answers of these.........? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "wanna know answers of these.........?" Watch "wanna know answers of these.........?" New topic

wanna know answers of these.........?

Harjeet Dadwal

Joined: Sep 09, 2001
Posts: 17
Here are some questions
1) what is difference between getPath() and getAbsolutePath() in file handling ?
2) what is difference between Reserve word or Keyword in JAVA and how many keywords are there in java ?
3) where can we get exercises or assignments of different java topics, just for practice ?
Harjeet Singh Dadwal

Harjeet Dadhwal
greg philpott
Ranch Hand

Joined: Nov 10, 2000
Posts: 73
Here are some answers:
1) getPath() returns the abstract pathname and getAbsolutePath() returns the full pathname.
example. try this to see for yourself:

2) Both Keywords and reserved words cannot be used as identifiers. The difference is keywords have special meaning in the language and reserved don't. There are 46 keywords and 2 reserved words.
James Gray
Ranch Hand

Joined: Sep 10, 2001
Posts: 30
Good answers above, but I would say that getPath() returns a "relative" path. Here's a mock example from a unix web server:
f.getPath() == "images/photo.jpg"
f.getAbsolutePath() == "/usr/httpd/images/photo.jpg"
The first one shows the path from the current working directory, while the second is the entire path from the root of the hard drive.
I agree. Here's the link:
subject: wanna know answers of these.........?
It's not a secret anymore!