Results 1 to 3 of 3
- 03-28-2008, 12:46 PM #1
Member
- Join Date
- Mar 2008
- Posts
- 2
- Rep Power
- 0
[SOLVED] Why import isnt needed whn ref is used without storing to local variable
Hello, Guys
This is my first thread to the Forum....
Consider this statement
System.getProperties().getProperty("propertyname") ;
for this statement import of java.util.Properties is not required, but we are using method of Properties
but it will required for this statements.
Properties props = System.getProperties();
props.getProperty("propertyname");
Whats the reason??
Regards,
Nachiket
- 03-30-2008, 10:43 PM #2
The System class does import java.util.Properties so it can handle this internally and return the String.Java Code:System.getProperties().getProperty("propertyname") ;
If you want to declare a Properties type/object in your app then you must import java.util.Properties into your app to support the type.
- 03-31-2008, 05:11 AM #3
Member
- Join Date
- Mar 2008
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
[SOLVED] curiosity about String type variable
By monir6464 in forum Advanced JavaReplies: 1Last Post: 04-08-2008, 11:13 AM -
storing and retrieving a file as such
By anil_manu in forum Advanced JavaReplies: 0Last Post: 03-11-2008, 01:27 PM -
Storing data permanently
By shaungoater in forum New To JavaReplies: 2Last Post: 03-10-2008, 04:18 PM -
is synchronization on method passing local variables as parameters needed
By reddzer in forum Java ServletReplies: 0Last Post: 11-10-2007, 04:47 PM -
Storing Data
By Khorod in forum New To JavaReplies: 1Last Post: 08-03-2007, 05:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks