wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "wanna know answers of these.........?" Watch "wanna know answers of these.........?" New topic
Author

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

Harjeet Dadwal
Greenhorn

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.
3) http://www.javaranch.com/cattledrive.jsp
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: wanna know answers of these.........?
 
Similar Threads
Java class and Java Bean
Difference between normal java and Android java
java [What are the differences between Java and C++?]
Java components
Java and Ruby