java system类
系统类mapLibraryName()方法 (System class mapLibraryName() method)
mapLibraryName() method is available in java.lang package.
mapLibraryName()方法在java.lang包中可用。
mapLibraryName() method is used to map a given library name into a platform-dependent native library name. This is a universal method for mapping a library name into the platform-specific name.
mapLibraryName()方法用于将给定的库名称映射到依赖于平台的本机库名称。 这是将库名称映射到特定于平台的名称的通用方法。
mapLibraryName() method is static a method, it is accessible with the class name too.
mapLibraryName()方法是静态方法,也可以使用类名进行访问。
mapLibraryName() method may throw an exception at the time of library name mapping: NullPointerException: In this exception if the mapped library name is null.
在库名映射时, mapLibraryName()方法可能会引发异常:NullPointerException:如果映射的库名为null,则在此异常中。
Syntax:
句法:
public static String mapLibraryName(String library_name);
Parameter(s):
参数:
String library_name – represents the name of the library.
字符串library_name –代表库的名称。
Return value:
返回值:
The return type of this method is String, it returns the mapped the given the library name.
该方法的返回类型为String ,它返回给定库名称的映射。
Example:
例:
// Java program to demonstrate the example of
// mapLibraryName() method of System Class
public class MapLibraryNameMethod {
public static void main(String[] args) {
// Display the version of operating system
System.out.println(System.getProperty("os.version"));
// Here, we are calling the mapLibraryName() method
// that will be used to map a library name (os.version)
// into a platform-specific string representing a native library
String s = System.mapLibraryName("os.version");
System.out.println(s);
}
}
Output
输出量
E:\Programs>javac MapLibraryNameMethod.java
E:\Programs>java MapLibraryNameMethod
4.8.0-41-generic
libos.version.so
翻译自: https://www.includehelp.com/java/system-class-maplibraryname-method-with-example.aspx
java system类