java system类_Java System类InheritedChannel()方法的示例

java system类

系统类InheritedChannel()方法 (System class inheritedChannel() method)

  • inheritedChannel() method is available in java.lang package.

    java.lang包中提供了InheritedChannel ()方法

  • inheritedChannel() method is used to return the channel inherited from the entity that generated current JVM (Java Virtual Machine).

    InheritedChannel()方法用于返回从生成当前JVM(Java虚拟机)的实体继承的通道。

  • inheritedChannel() method is a static method so this method is accessible with the class name too.

    InheritedChannel()方法是静态方法,因此也可以使用类名访问此方法。

  • inheritedChannel() method may throw a various exception and the description of the exception is given below:

    InheritedChannel()方法可能会引发各种异常,并且该异常的说明如下:

    • IOException: In this exception, the exception will be thrown related to input/output error.IOException:在此异常中,将引发与输入/输出错误相关的异常。
    • SecurityException: In this exception, it does not allow access to the Channel when security manager exists.SecurityException:在这种例外情况下,当安全管理器存在时,它不允许访问Channel。

Syntax:

句法:

    public static Channel inheritedChannel() throws IOException{
    }

Parameter(s):

参数:

  • It does not accept anything.

    它不接受任何东西。

Return value:

返回值:

The return type of this method is Channel, it returns the inherited channel if channel is inherited, else it returns the null.

此方法的返回类型为Channel ,如果channel是继承的,则返回继承的通道,否则返回null。

Example:

例:

// Java program to demonstrate the example of 
// inheritedChannel () method of System Class

public class InheritedChannelMethod {
    public static void main(String[] args) {

        try {
            System.out.println("Inherited Channel: " + System.inheritedChannel());
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }

    }
}

Output

输出量

E:\Programs>javac InheritedChannelMethod.java
E:\Programs>java InheritedChannelMethod
Inherited Channel: null


翻译自: https://www.includehelp.com/java/system-class-inheritedchannel-method-with-example.aspx

java system类

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值