java system类_Java System类mapLibraryName()方法及示例

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类

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值