Share via


JavaSystem.GetProperty Method

Definition

Overloads

GetProperty(String)

Gets the system property indicated by the specified key.

GetProperty(String, String)

Gets the system property indicated by the specified key.

GetProperty(String)

Gets the system property indicated by the specified key.

[Android.Runtime.Register("getProperty", "(Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? GetProperty (string key);
[<Android.Runtime.Register("getProperty", "(Ljava/lang/String;)Ljava/lang/String;", "")>]
static member GetProperty : string -> string

Parameters

key
String

the name of the system property.

Returns

the string value of the system property, or null if there is no property with that key.

Attributes

Remarks

Gets the system property indicated by the specified key.

First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument. This may result in a SecurityException.

If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.

Java documentation for java.lang.System.getProperty(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetProperty(String, String)

Gets the system property indicated by the specified key.

[Android.Runtime.Register("getProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? GetProperty (string key, string? def);
[<Android.Runtime.Register("getProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")>]
static member GetProperty : string * string -> string

Parameters

key
String

the name of the system property.

def
String

a default value.

Returns

the string value of the system property, or the default value if there is no property with that key.

Attributes

Remarks

Gets the system property indicated by the specified key.

First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument.

If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.

Java documentation for java.lang.System.getProperty(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to