System.inheritedChannel(): This method is available in java.lang.System class of Java.
Syntax:
Channel java.lang.System.inheritedChannel() throws IOException
This method returns the channel inherited from the entity that created thisJava virtual machine. This method returns the channel obtained by invoking the inheritedChannel method of the system-wide default java.nio.channels.spi.SelectorProvider object.
Parameters: NA
Returns: The inherited channel, if any, is otherwise null.
Throws:
1. IOException - If an I/O error occurs.
2. SecurityException - If a security manager is present and it does not permit access to the channel.
Approach
Java
import java.io.IOException;public class SysteminheritedChannel {public static void main(String[] args) throws IOException {System.out.println(System.inheritedChannel());}}
Output:
null
No comments:
Post a Comment